Form Attributes Dialog

See Also

Use the Form Attributes dialog to specify the basic attributes of a form.  This dialog is displayed by selecting the Form Attributes command from the Form Design menu when a form is in design mode.

Dialog Entries

ID

The form ID is the unique identifier of the form when it is stored in the database.  Enter a name  from 1 to 8 letters (A-Z) or digits (0-9).  You must specify a unique identifier for a form before the form can be stored in the database.  Pop-up edit forms that are part of a list do not need identifiers, since they are saved with the list.

Description

A name for the form that can be up to 32 characters long.  The description is displayed in form selection lists.

Database Access Permissions

Check this option	To

Add New Records	Allow the user of the form to add new records to the database through the form.  If this option is checked, the form must also contain all the required fields of the root table of the form view.

Edit Records	Allow the user to edit records with the form.

Delete Records	Allow the user to delete records with the form.

Search Window

Check this option if you want the form to have a search window.  A search window is a pop-up browse list that enables you to quickly locate and display a record from the database on a form.  If you add a search window, the search icon on the form's control pad will appear.

Data Exchange Template

Check this option if you want to add a data exchange template to the form.  When this option is checked, the DX Template button is enabled.

View Button

Select the View button to display the Edit View dialog, which enables you to define the data view associated with the form.

DX Template Button

Select the DX Template button to display the DX Template dialog, which enables you to define the data exchange template associated with the form.


Designing Forms

Designing Lists

Designing Data Exchange Templates

Edit View Dialog


List Attributes Dialog

See Also

Use the List Attributes dialog to define the attributes of a list.

Dialog Entries

ID

The list ID is the unique identifier of the list when it is stored in the database Forms Table.  Enter a name  from 1 to 8 letters (A-Z) or digits (0-9).  You must specify a unique identifier for a list before you can save it in the database.    Special lists that are part of a form, such as search windows and lists embedded in scroll regions, do not need identifiers, since they are saved as part of form.

Description

A descriptive name for the list that can be up to 32 characters long.  The description is used most places in Ad Hoc to help you identify a list.

Style

Specify the following style options for the list:

Style Option	Description

Column Headings	The list will display a non-scrolling column heading line above the scrolling area.  You edit the column headings in the Column Heading control on this dialog.

Search Control	The list will contain a search control, which enables the user to enter search keys to find a record in the list.

Sort Control	The list will contain a sort control, which enables the user to change the sort order of the list.

No Buttons	The list will contain no control buttons.

OkCancel	The list will contain two control buttons: OK and Cancel.  This style is for lists that are search windows of a form.

AddEditDelete	The list will contain three control buttons: Add, Edit, and Delete.  This style enables the list to be used for adding, editing, and deleting records.  It also attaches a pop-up edit form to the list, which you must design.

Database Access Permissions

You can set database access permissions for a list that has the AddEditDelete style.  A list with this style option has a pop-up form attached to it to enable adding and changing records.

Check this option	To

Add New Records	Allow the user of the list to add new records to the database through the list.  If this option is checked, the pop-up edit form must also contain all the required fields of the root table of the form view.

Edit Records	Allow the user to edit records displayed on the list.

Delete Records	Allow the user to delete records displayed on the list.

Column Heading

You can add column headings to a list if the Column Heading style option is set.  The default heading for a column is the description of the field stored in the data dictionary as part of the field definition.

You can edit the column heading for the field that is currently highlighted in the Displayed Fields list box,  Column heading can be more than one line; to start a new line, press the ENTER key and type the new line.

Displayed Fields

Use this section of the List Attributes dialog to select the database fields that will be displayed in the columns of the list.  The Displayed Fields section contains two list boxes.  The list box on the right (the View Fields list) contains  the fields that have been defined in the data view for the list.  Not all the fields in the view need to be part of the list display.  Some of them may only appear on the pop-up form.   The list box on the left  (the Displayed Fields list) displays the fields that you select to be displayed in the list, in the order they will appear on the list from left to right.  Use the buttons between the two list boxes to add or remove fields from the display list:

Click	or Press	To

Add	Alt-A	Add the field selected in the View Fields list to the end of the Displayed Fields list.

Insert	Alt-I	Insert the field selected in the View Fields list before the field selected in the Displayed Fields list.

Delete	Alt-D	Remove the field selected in the Displayed Fields list from the list.

Shortcut:

You can also double-click on a field in the View Fields List to add it to the end of the Displayed Fields list; and double-click on a field in the Displayed Fields list to remove it from the list.

View Button

Click the View button to display the Edit View dialog, and edit the definition of the data view associated with the list.  Since only fields that are included in the data view can be assigned to columns in the list, you must define the fields in the data view before you can specify the fields that will be displayed on the list.


Designing Lists


Edit View Dialog

Use the Edit View dialog to define a data view.  You will use this dialog to define the data view associated with a number of objects in Ad Hoc, including forms, lists, and reports.  The definition of a data view includes the root table of the view, the fields of the view, an optional sort specification, and an optional selection filter.

Dialog Options

Root Table

You must specify a root table for a data view.  The Root Table combo box contains a list of all the tables defined in the database.  You must select a root table from this list before you can design the other characteristics of the view.  If you subsequently change the root table, the field list, which is based on the root table, must be redefined.

Fields

Use the Fields section of the Edit View dialog to designate the fields of the view.  This section contains two list boxes and a number of buttons.  The list box on the left (the View Fields list) contains the extended IDs of the fields selected for the view.  This list box on the right (the Available Fields list) contains the fields that are available to be included in the view.  Available fields include all the fields in the root table, and all the fields in each table that is related to the root table by a defined link.  Initially, the Available Fields list contains the fields of the root table, and also contains the root table links to other tables.

Fields are displayed in these lists in alphabetical order by extended ID.

Click	or Press	To

Add	Alt-A	Add the field selected in the Available Fields list to the View Fields list.

Delete	Alt-D	Remove the field selected in the View Fields list from the list.

All	Alt-L	Add all the fields in the Available Fields list to the View Fields list.  If some of these fields are already in the View Fields list, they will not be duplicated.

Req	Alt-R	To add all the required fields in the Available Fields list to the View Fields list.  This button is helpful if you are designing a view that will be used to add new records to the root table, which requires the view to contain all the required fields of the table.

More	Alt-M	To change the Available Fields list to contain the fields of a table that is linked to the currently displayed table.  You can select More whenever a link ID is highlighted in the Available Fields list.

Back	Alt-B	To change the Available Fields list back to the previous table through a link.  When the Available Fields list displays the fields of the root table, you cannot use the Back command.

Shortcut:

You can double-click on a field ID in the Available Fields list to add it to the View Fields list.  Double-clicking on a link ID in this list is the same as clicking the More button.  You can double-click on a field ID in the View Fields list to remove it from the list.

Sort

The Sort section of the Edit View dialog displays the sort specification you have defined for the view.  Click the Sort button, or press Alt-S, to display the Sort Specification Dialog, which enables you to define the way the view records are sorted.

Filter

The Filter section of the Edit View dialog displays the filter rules (selection criteria) you have defined for the view.  Click the Filter button, or press Alt-F, to display the Filter Rules dialog, which enables you to define the filter.

If you do not define a filter for a data view, the records of the view will correspond on a one-to-one basis with the records in the root table of the view.


Sort Specification Dialog

Use the Sort Specification dialog to define the sort order of a data view.  The sort order is defined by designating a list of fields in the view whose values will be used to sort the view records.  The order of the fields in the sort specification is important.  The first field in the list is the primary sort key, the second field is used next, and so on.

The Sort Specification dialog contains two list boxes and a number of control buttons.  The list box on the left (the Sort Field list) displays the fields used for the sort.  The list box on the right (the View Fields list) displays the fields that have been defined for the view that can be used to sort records.  You can sort using character, numeric, or date fields.

Click	or Press	To

Add	Alt-A	Add the field selected in the View Fields list to the end of the Sort Fields list.

Insert	Alt-I	Insert the field selected in the View Fields list before the field selected in the Sort Fields list.

+/-	Alt-+	Change the sort direction of the field selected in the Sort Fields list to either ascending (sorted from low to high values) or descending (sorted from high to low values).

A descending sort field will be displayed with a "-" sign after it.

Delete	Alt-D	Remove the field selected in the Sort Fields list from the list.

Clear	Alt-C	Remove all the fields from the Sort Fields list.

Shortcut:

You can double-click on a field in the View Fields list to add it to the bottom of the Sort Fields list.  You can double-click on a field in the Sort Fields list to remove it from the list.


Filter Rules Dialog

Use the Filter Rules dialog to define a selection filter for a data view.  The Filter Rules dialog contains a list of the rules you have defined.  Below this list are several buttons you can use to add or edit the rules in the list.

Click	or Press	To

Add	Alt-A	Add a rule.  After an add, the Add button becomes the default push-button, so that pressing ENTER causes another rule to be added.  Add displays the  Edit Filter Rule dialog.

Insert	Alt-I	Insert a new rule before the rule that is highlighted in the list.  After an insert, the Insert button becomes the default push-button, so that pressing ENTER causes another rule to be inserted.  Insert displays the Edit Filter Rule dialog.

Edit	Alt-E	Change the rule that is highlighted in the list.  After an edit, the Edit button becomes the default push-button, so that pressing ENTER after highlighting another rule causes that rule to be edited.

Delete	Alt-D	Remove the highlighted rule from the list.

Clear	Alt-C	Remove all the rules from the list.

Shortcut:

Double-clicking on a rule in the list will display the Edit Filter Rule dialog so that you can edit the rule.


Edit Filter Rule Dialog

Use the Edit Filter Rule dialog to edit the definition of a filter rule.

Dialog Options

Database Field

This combo box will contain a list of the fields defined for the view.  Select the field whose value will be used for this filter rule.

Comparison

Select the comparison operation to be performed on the value of the field.  The value of the field is compared to the value you enter in the Value edit box, or the value of the field that you specify in the Value edit box.  The comparisons are:

Code	Description	The rule is TRUE for a field if

EQ	equal to	the value of the field is equal to the comparison value

GT	greater than	the value of the field is greater than the comparison value

LT	less than	the value of the field is less than the comparison value

NE	not equal to	the value of the field is not equal to the comparison value

GE	greater than or equal to	the value of the field is greater than or equal to the comparison value

LE	less than or equal to	the value of the field is less than or equal to the comparison value

CO	contains	the field is of type Character and it contains the character string in the comparison value

NN	not null	the field is not null, it contains a value (which may be zero for numerical fields)

NU	null	the field is null (blank), it contains no value

Value

If the Value option is selected, the field is compared to the value that you enter in the Value edit box.

Field

If the Field option is selected, the edit box becomes a combo box with a list of possible fields that can be used for the comparison value.  The value of the rule field is compared to the value of the field you specify in the combo box.  This option will not always be available.  You will see it when you define a filter for a report data view.  This allows you to filter the records for the report by comparing fields in the records with report fields.

Comparison Options

Option	Meaning

case sensitive	This option is available if the view field for the rule is of type Character.  If you select this option, the comparison will take the case of the letters into account.  If the rule is not selected, the case of the letters will be ignored.

For case sensitive comparisons, "The" is not equal to "the".  Upper case letters (A-Z) come before lower case letter (a-z) in the sort order.  Therefore "Zoo" would come before (be less than) "airplane".

For most applications, do not select this option.

month and day only	This option is available if the view field for the rule is of type Date.  If you select this option, the comparison is made only for the month and day part of the date.

ignore if null	This option is available if you are comparing the view field to another field.  If this option is set, the rule is ignored (i.e. it is automatically TRUE) if the comparison field is null.

Connector to following rule

The option you select here determines how the filter rules are combined to determine whether a record passes or fails the filter.  The connections between rules are evaluated sequentially.  The combination of the first two rules is evaluated, and the result is combined with the next, etc.  If the result of list of rules is TRUE, then the record passes the filter.  If it is FALSE, the record does not pass (and is not considered part of the view).

Here is how the evaluation is done for two rules:

If Rule A is	and Rule B is	Then

TRUE	TRUE	A and B is TRUE

A or B is TRUE

TRUE	FALSE	A and B is FALSE

A or B is TRUE

FALSE	TRUE	A and B is FALSE

A or B is TRUE

FALSE	FALSE	A and B is FALSE

A or B is FALSE

Some combination examples:

TRUE and TRUE or FALSE is evaluated as TRUE

TRUE and FALSE and FALSE is evaluated as FALSE

TRUE or FALSE and TRUE is evaluated as TRUE

TRUE or FALSE and FALSE is evaluated as FALSE

Displaying Filter Rules

When a filter rule is displayed, for example in the Filter Rules dialog list on the Edit View dialog, it appears as:

FIELDID equals "value"	for fields compared with a set value

FIELDID equals FIELDID	for fields compared with other fields

If you have set one or more comparison options, they will follow the rule in parentheses:

(m/d)	month and day comparison

(cc)	case sensitive

(i)	ignore if null


Form Links Dialog

Use the Form Links dialog to define a link between two forms.  When two forms are linked, one is the master form and one is the dependent form.  The current record in the master form determines the records that are filtered in the view of the dependent form.

This dialog is displayed when a form or list is the active desktop object and you select the Form Links command on the File menu.  The active form or list is the master form, and the Form Links dialog will display all the dependent forms that are linked to it, as well as other forms on the desktop that you may link to it.  The Form Links dialog enables you to redefine existing links, add new linked forms, or delete existing links.

Linked Forms

The Linked Forms list shows the dependent forms and lists that are linked to the master form.  If the master form contains an imbedded list (scroll region) that is linked to it, the designation "(imbedded)" follows the linked form's name.  You cannot change the link definition or remove the link of an imbedded form link, but you can view the definition.

Open Forms

The Open Forms list shows the forms that are open on the desktop and available to be linked to the master form.  A form that is already linked as a dependent of another form is not available for linking.  A form can be a master to many dependent forms, but can have only one master.  You also cannot link a form to another instance of the same form.

To Link a form or list to the active form

1.	Select the form or list in the Open Forms list

2.	Click on Link, press Alt-L, or double-click the entry in the Open Forms list

3.	Describe the link in the Edit Link dialog

4.	The linked form will be added to the Linked Forms list

To Remove a link

1.	Highlight the linked form in the Linked Forms list

2.	Click on Unlink, press Alt-U, or double-click the entry in the Linked Forms list

3.	The form is removed from the Linked Forms list and returned to the Open Forms list

To change the way two forms are linked

1.	Highlight the linked form in the Linked Forms list

2.	Click on Edit Link, or press Alt-E

3.	Edit the link description on the Edit Link dialog

If the link is to an imbedded form or list, you cannot change the link definition, but you may view it.


Edit Link Dialog

Use the Edit Link dialog to define the link between two forms.  You will see this dialog when you link two desktop objects with the Form Links command on the File menu, and also when you define the link between a form and an embedded list designed on the form.

The Edit Link dialog contains two lists of fields.

On the left is a list of the fields in the data view of the dependent form to be linked.

On the right is a list of the fields in the data view of the master form.

To define a link, you will select one or more fields in the dependent form view that will be filtered by the value of a corresponding field in the master view.  A record in the dependent view is selected (passes the filter) only if all the fields defined in the link have the same value as the fields designated in the master form view.

To define a pair of linked fields

1.	Select a field from the dependent form's view in the list on the left

2.	If there is one or more equivalent field in the master form's view, these fields will be displayed in the list on the right

3.	Select the field in the master form's view on the right that the dependent field must match

4.	The match will be displayed in the box at the bottom of the Edit Link dialog

To remove a pair of linked fields

1.	Select the field from the dependent form view in the list on the left

2.	Select "none" in the list on the right

To remove all field matches (clearing the link definition)

1.	Click on Clear, or press Alt-C

You can enter as many field matches as you want to define the link between the forms.  As soon as you accept the definition of the link, by clicking the OK button, or pressing ENTER, the dependent form is linked to the master form.

Note: Depending on the number of records in the dependent form and the how heavily the link filters the dependent form, you may experience a delay after the link is defined as Ad Hoc reads through the dependent view to find records that match the link.  You may also experience a delay when you change records in the master form.


Fonts Dialog

Use the Fonts dialog to define the fonts used for a form or list.  This dialog is displayed by the Fonts Command on the Form Design menu and on the List Design menu.

Dialog Options

Display Objects

This is a list of the items for which you can designate a font.  Select an item in this list, and define the characteristics of its font on the right side of the Fonts dialog.

Type Face

Enter the name of the type face for the font.

Point Size

Enter the size of the font in points (a point, the unit of measure used for the height of the font, is 1/72 inch).

Bold

Check this option for a bold font.

Italic

Check this option for an italic font.

Fonts Button

Instead of entering the font characteristics into the above dialog controls, you can click the Fonts button to display  a Font selection dialog that is supplied in Windows.  The Windows font selection dialog displays a list of all the fonts installed on your computer.  From this dialog you can select a font, a point size, and the other available font styles such as bold and italic.

Note: If you are designing a form or list that will be used on another machine or across a network, make sure that you select fonts that are available on other machines.


Colors Dialog

Use the Colors dialog to change the colors of a form or list.  This dialog is displayed by the Colors command on the Form Design menu and on the List Design menu.  The dialog contains a color combo box for each display object on the form or list for which you can set the color.

The default color of an object is the color that is supplied by Windows based on color selections that the user makes with the Windows Control Panel.  To override the default, select a specific color.  The default color is displayed in the combo box as it is defined by the Control Panel.

Warning:  Make sure you choose different colors for the text and background of an object, or the text will not appear.  Experiment until you find a pleasing color combination.

Hint:  When you are designing a form, it helps to make the form background color and the data background color different.  This will help you locate and size controls on the form.  A control with no border style and with no data displayed will be invisible on the form unless it is selected, or unless it is a different color than the form.


Edit Control Attributes Dialog

Use the Edit Control Attributes  dialog to define the attributes of an edit control on a form.  This dialog is displayed when a form is in design mode and you:

Select the New Edit command on the Form Design menu

Click the right mouse button when the cursor is over an existing edit control on the form.

Select the Control Attributes command from the Form Design menu when an edit control is selected (highlighted).

Dialog Options

Field

The Field combo box contains a list of the fields defined in the data view associated with the form.  Select the field that will be displayed (and optionally edited) in the edit control you are defining.

Title

Enter the title, if any, to be attached to the edit control.  Ad Hoc will supply the description of the field from the data dictionary as a suggested title, but you can change the title if you wish.

Title Position

Select the position of the title on the form relative to the position of the edit control .

Position	Description

None	No title will be displayed

Left	The title will appear to the left of the edit control

Right	The title will appear to the right of the edit control

Above	The title will appear above the edit control, aligned with the left edge of the control

Below	The title will appear below the edit control, aligned with the left edge of the control

Style

Select the display style of the edit control:

Style	Description

None	The edit control will display its contents only.  It will have no border or underline.

Underline	The edit control will appear with a line under the contents.  This will make it appear as an entry on a paper form.

Border	the edit control will have a single line border around the data area.

An edit control with no title and no display style (and no displayed contents) will be hard to locate on the form when you are laying the form out.  To more easily lay out the form, it is suggested that you change the colors so that the form background and data background colors are different during the design process.  You can change them back later, if desired.

Display Only

Check the Display Only option if you want the edit control to display the field data, but not allow the user to edit the data.  A display-only control cannot be edited, and cannot be tabbed to (although when you are setting the tab order of the form, you should include it).  If you have defined the field displayed in the edit control as a field from a table other than the root table of the form view, the Display Only attribute will automatically be set.  You can edit only fields from the root table of the view.

Don't validate using table links

Normally, if a field in a form view is part of a link to another table, Ad Hoc will use the link to validate the value you enter into the field.  It also uses the link to display a lookup window to allow you to select a value from a list.

If you check this option, Ad Hoc will not validate your entries in this control against the lookup table, allowing you to enter values that don't appear in the lookup table.  You can still use the lookup table to select values, however.


Combo Box Attributes Dialog

Use the Combo Box Attributes dialog to define the attributes of a combo box control on a form.  This dialog is displayed when a form is in design mode and you:

Select the New Combo Box command on the Form Design menu.

Click the right mouse button when the cursor is over an existing combo box control on the form.

Select the Control Attributes command from the Form Design menu when a combo box control is selected (highlighted).

A combo box can be used to edit a field that has been assigned the Lookup validation style (See Define Field Dialog).  The valid lookup values you define for the field appear in the drop down list of the combo box.  A combo box cannot be display only.  If you want to only display a field on a form, use a display-only edit control.

Dialog Options

Field

The Field combo box contains a list of the fields defined in the data view associated with the form that have a Lookup validation type.  Select the field that will be edited in the combo box control you are defining.

Title

Enter the title, if any, to be attached to the combo box control.  Ad Hoc will supply the description of the field from the data dictionary as a suggested title, but you can change the title if you wish.

Title Position

Select the position of the title on the form relative to the position of the combo box control .

Position	Description

None	No title will be displayed

Left	The title will appear to the left of the combo box

Right	The title will appear to the right of the combo box

Above	The title will appear above the combo box, aligned with the left edge of the control

Below	The title will appear below the combo box, aligned with the left edge of the control

Style

Select the display style of the combo box:

Style	Description

Select Description	The value must be selected from the drop down list.  The list displays the long description associated with the field value defined in the data dictionary.

Select Code (Description)	The value must be selected from the drop down list.  The list displays the field value, followed by the long description in parentheses.


Text Box Attributes Dialog

Use the Text Box Attributes dialog to define the attributes of a text box control on a form.  This dialog is displayed when a form is in design mode and you:

Select the New Text Box command on the Form Design menu.

Click the right mouse button when the cursor is over an existing text box control on the form.

Select the Control Attributes command from the Form Design menu when a text box control is selected (highlighted).

A text box control must be used to edit a field of type Text.  A text box is similar to an edit control, except that it can display more than one line of text.  If the contents of the Text field are too large to display in the text box, scroll bars allow you to scroll through the text.

Dialog Options

Field

The Field combo box contains a list of the fields of type Text defined in the data view associated with the form.  Select the field that will be edited in the text box control you are defining.

Title

Enter the title, if any, to be attached to the text box control.  Ad Hoc will supply the description of the field from the data dictionary as a suggested title, but you can change the title if you wish.

Title Position

Select the position of the title on the form relative to the position of the text box control .

Position	Description

None	No title will be displayed

Left	The title will appear to the left of the text box

Right	The title will appear to the right of the text box

Above	The title will appear above the text box, aligned with the left edge of the control

Below	The title will appear below the text box, aligned with the left edge of the control

Style

Select the desired display style options of the text box:

Style	Description

Border	Check this option to display a border around the text box.

Vertical Scroll Bar	Check this option to include a vertical scroll bar on the right side of the text box.  If there is no scroll bar, you can still scroll through the contents of the text box with the up and down cursor keys.

Display Only	Check this option to make the text box display only.  The user cannot edit the contents of a display only text box.


Scroll Region Attributes Dialog

Use the Scroll Region Attributes dialog to define the attributes of a scroll region control on a form.  This dialog is displayed when a form is in design mode and you:

Select the New Scroll Region command on the Form Design menu.

Select the Control Attributes command from the Form Design Menu when a scroll region control is selected (highlighted).

Select the Control Style command on the List Design menu of the list that is embedded in the scroll region.

A scroll region is a special type of form control that enables an embedded list to be placed on a form.  You design the attributes of the scroll region control with this dialog, and design the attributes of the list using the List Design menu that is displayed when you click the right mouse button when the mouse cursor is over the list.

Dialog Options

Title

Enter the title, if any, to be attached to the scroll region.  There is no default supplied.  Enter a title that relates to the contents of the list embedded in the control.

Title Position

Select the position of the title on the form relative to the position of the scroll region .

Position	Description

None	No title will be displayed

Left	The title will appear to the left of the scroll region, aligned with the bottom edge

Right	The title will appear to the right of the scroll region, aligned with the bottom edge

Above	The title will appear above the scroll region, aligned with the left edge

Below	The title will appear below the scroll region, aligned with the left edge


Quick Form Layout Dialog

Use the Quick Form Layout dialog to have Ad Hoc automatically place edit controls on a new form for fields that you have defined in the data view of the form.  This dialog is displayed by selecting the Quick Layout command on the Form Design menu.  Quick Layout can be done only if the form does not yet contain controls.

Place the fields that you want to create edit controls for in the Displayed Fields list on the dialog in the order that you want the controls placed on the form.  If you want to use a combo box control for a field, don't include it in the list and add the combo box control later.  Or you can include it in the list to make a place for it, then later delete the edit control and replace it with a combo box control.

Dialog Options

Displayed Fields

The Displayed Fields List on the left side of the dialog contains the fields for which edit controls will be created.  This View Fields list on the right contains all the fields in the data view associated with the form that can be assigned to an edit control.  It will not contain Text fields, or fields of other types that cannot be edited in an edit control.

Click on	or Press	To

Add	Alt-A	Add the field selected in the View Fields list to the end of the Displayed Fields list.

Insert	Alt-I	Insert the field selected in the View Fields list before the field selected in the Displayed Fields list.

Delete	Alt-D	Remove the field selected in the Displayed Fields list from the list.

All	Alt-L	Add all the fields in the View Fields list to the Displayed Fields list.  Note that they are added in the order they appear in the View Fields list, which may not be the order you want them to appear on the form.

Shortcut:

You can double-click on a field in the View Fields list to add it to the Displayed Fields list.  You can double-click on a field in the Displayed Fields list to remove it from the list.

Vertical Separation

Controls will be placed on the form one below the other.  Vertical separation defines the distance between the bottom of one control and the top of the next.  A vertical separation of 8 is equivalent to the height of a character in the font you have selected for the data on the form.  A vertical separation of 4 is the default.

Left Margin

Enter a number for the distance each control will be placed from the left edge of the form.  A left margin of 4 is equivalent to the average width of character in the font you have selected for the data on the form.  A left margin of 4 is the default.

Title Position

This option cannot be changed in the current version of Ad Hoc.  All controls will be created with a Left style title position.

Border Style

Select the border style that all controls will have (See Edit Control Attributes dialog for a description of the border style options).


Data Exchange Template Dialog

Use the Data Exchange Template dialog to define the attributes of a data exchange template attached to a form.  This dialog is displayed when you select the Data Exchange Template command on the Form Design menu.

Dialog Options

Record Format

Select the format of the file that data will be imported from or exported to.

Format	Description

Fixed Field ASCII	The file is an ASCII text file.  Records in the file are separated by a carriage return-line feed combination.  Within each record the fields are a fixed length defined in the DX Record Layout dialog.

Delimited ASCII	The file is an ASCII text file.  Records in the file are separated by a carriage return-line feed combination.  Within each record the fields are separated by a delimiter character.  In the current version, this must be a comma.

If a field contains the delimiter character, the entire field must be enclosed in double quote characters ("xxx").  On export, Ad Hoc  always adds the double quotes.

Comma Separated Values	The same as Delimited ASCII above, except that the field delimiter is always a comma.

Date Format Option

Select the date format used when exporting Date fields, or expected when importing Date fields.  See Date Field for a description of the date format options.  All date formats can be exported.  Some date formats cannot be imported.  If you select one of these, Ad Hoc will warn you that it cannot import the date format you selected.

For fixed-field ASCII records, make sure the length of a date field is large enough to accommodate the selected format.

Export Upper Case

Check this option if you want fields in exported records to be in all upper case letters.  This does not affect records that are imported.  The case of records imported into the database is controlled by the case specified in the definition of each field in the data dictionary.

Layout Button

A data exchange template must include a field layout, which designates how the characters in an ASCII record relate to fields in the database.  Click the Layout button to display the DX Record Layout dialog.  For fixed-field ASCII record types, the position and size of the fields in the list is important.  For delimited ASCII or comma separated value record types, only the order of the fields is important.  The information in the layout must match exactly the actual layout of imported records, or the import operation will generate errors.


DX Record Layout Dialog

Use the DX Record Layout dialog to define the record layout of the ASCII records that will be imported or exported using a data exchange template.  The dialog contains two list boxes.  The list box on the left (the Layout list) displays the list of fields defined in the layout.  The list box on the right (the View Fields list) displays the fields of the data view associated with the data exchange template.  (The view for the template is the same as the data view associated with the form that the template is being defined for.)

Click on	or Press	To

Add	Alt-A	Add the field selected in the View Fields list to the end of the Layout list

Insert	Alt-I	Insert the field selected in the View Fields list before the field selected in the Layout list

Edit	Alt-E	Edit the length of the field selected in the Layout list

Delete	Alt-D	Delete the field selected in the Layout list

When you add a field to the Layout list, it is added with a length equal to the edit length that you specified when you defined the field in the data dictionary.  You can change this length by using the Edit button or double-clicking on the field entry in the Layout list.  The field length applies only if you are exporting to or imported from a file in a fixed-field format.

Warning

If you are exporting data, and the field in the database is longer than the field length defined in the record layout, the field contents are truncated.  If the field in the database is shorter, the field in the export file is padded on the right with blanks.

If you are importing data, and the field in the database is shorter than the field length defined in the record layout, the field contents are truncated.

Sample Record

At times, you have an existing file of data that you want to import, but may not be sure of the layout of the file.  The Sample Record area of the DX Record Layout dialog provides support to determine if your layout matches the data in a sample record of the file to be imported.

Note: Use the Sample Record area of the dialog only for files that have a fixed-field format.

To look at a sample record of a file to be imported, enter the pathname of the file in the File Pathname edit box.  Then click the Sample button.

A sample of the first record in the file will appear in the record display area.  When you select a field in the Layout list, the corresponding region of the sample record will be highlighted.  Check each field to see if your layout makes sense.  The end of the record is marked by a vertical line, which should not be highlighted when you select the last record in your layout.


Data Import Dialog

Use the Data Import dialog to start a data import process.  This dialog is displayed when you select the Import command on the Form menu.

Dialog Options

Input File Pathname

Enter the full pathname of the file that contains data that you want to import.

Delete After Reading

Check this option if you want the file deleted after the data is imported.  If you select this option, make sure that you have selected a suspense file option, so that records with errors will be saved to a suspense file so that you can correct them and read them later.

Record Edit Options

The record edit option determines when records read from the input file are displayed on the form for you to review and edit before they are imported into the database.

Option selected	Action taken

None	No records are displayed on the form, the import proceeds uninterrupted.  If records contain errors, they are put into a suspense file without notifying the user.

Errors Only	Records with errors are displayed on the form, and the import waits until the user edits the record and either inserts it into the database or into the suspense file.

All	All records are displayed on the form, and the user must approve each record before it is inserted into the database.

Suspense File

If you want records that contain errors to be stored in a suspense file instead of discarded, supply a valid pathname for the suspense file.  You can later edit the records in this file and insert them into the database.

Option	Description

None	Records with errors are not put into a suspense file, they are discarded.

Append	Records are appended to the end of the suspense file.

Overwrite	If the suspense file that you enter contains information, it is replaced by the new records added to the suspense file.


Data Export Dialog

Use the Data Export dialog to start a data export process.  This dialog is displayed when you select the Export command on the Form menu.

Dialog Options

Output File Pathname

Enter a valid file pathname for a file that will receive the records exported from the database.

If the file you specify exists, one of these options is used:

Export Option	Description

Append	The exported records are appended to the contents of the file.

Overwrite	The contents of the file are replaced by the exported records.

Records are exported using the sort and filter options defined for the data view of the form.  If no sort specification is supplied in the view definition, records are exported using the current index of the view.  The current index is the one specified in the Search Window of the form, if one is defined, otherwise it is the primary key order.


Form Selection Dialog

Use the Form Selection dialog to select a form, list, or desktop layout from the database.  Use the up and down arrow keys to highlight the desired selection, or just click on it with the mouse.  Then press the Enter key, click the OK button, or double-click the left mouse button to select the highlighted entry.

The check boxes below the list enable you to select the type of object that appears in the list.

The list box in this dialog is an Ad Hoc list, which means that you can use Ad Hoc keystroke navigation to highlight an entry.


Database Table Dialog

See Also	Procedures

Use the Database Table dialog to define a database table.  The table definition is stored in the data dictionary of the database.  This dialog is displayed when you select the New Table command or the Edit Table Definition command on the Tables menu.

Using this dialog, you can define a database table, along with its fields, indexes, and links to other tables.

Dialog Entries

Table ID

Enter a unique identifier for the table in the database.  A Table ID can be a combination of one to eight characters: letters (A-Z) or digits (0-9).  The Table ID should convey some meaning to the user of what the table contains, if possible.  When you first fill out this dialog for a new table you can change the ID up to the point that you accept the dialog entries.  Once a table definition has been entered into the data dictionary, you cannot change the ID.

Description

Enter a descriptive name for the table.  The description can be up to 32 characters.  Use a description that makes it easy for the user to identify the table.  The description can be changed later if necessary.

Type

Select the type of file that will be used to store the table.  Currently, Ad Hoc supports only one type of file format.

File Type	Description

Ad Hoc	The standard file type for Ad Hoc database table files.

File Name

Enter the filename for the table file.  Ad Hoc will suggest a default filename, comprised of the Table ID with the extension .DBF.  You can change this default to any valid filename for a new table.  For an existing table (for which the file has already been created), if you change the file name in the table definition, Ad Hoc will not change the name of an existing DOS file with the old name.  Instead, Ad Hoc will report that it cannot find a file for the table with the new name, unless the new name is the name of an already existing file.

Path

If you want the table file to be created in the same directory as the data dictionary and database system files, leave this entry blank.  This is the usual situation.  If, for whatever reason, you want the table file to be in another directory, or on another disk, enter the pathname  here.  Don't include the filename.  For example, if you want the file to be located in a subdirectory called DATA on drive C:, enter C:\DATA for the path.

Fields Button

Click the Fields Button to see or fill out a list of the fields defined for the table.

Indexes Button

Click the Indexes Button to see or fill out a list of the indexes defined for the table.

Links Button

Click the Links Button to see or fill out a list of the links to other tables defined for this table.

To work with items in the list

Click on	or Press	To

Add	Alt-A	Add an item (field, index, or link) at the end of the list.

Insert	Alt-I	Insert an item before the item that is selected in the list.

Change	Alt-C	To change the definition of the selected item in the list.

Delete	Alt-D	To delete the selected item in the list.

Hint

You can double-click on an item in the list to display the dialog for that item.


Designing Tables

Designing a Database

Define Field Dialog

Define Index Dialog

Define Link Dialog

Introduction to Databases


Define Field Dialog

Use the Define Field dialog to define a field in a database table.

 Dialog Entries

ID

Enter a unique identifier for this field.  No two fields in the same table can have the same ID.  Fields in different tables can have the same ID, but you should avoid this for sake of clarity.  The ID can be any combination of from one to eight letters (A-Z) and digits(0-9).

Title

Enter a title for the field of from one to 32 letters or digits.  The title is a descriptive phrase that will be used as a default title for the field on forms and lists.

Required

Check this option if want to require that a field must contain a value (cannot be null, or blank) in each record in the table.  When the user enters data on a form, Ad Hoc will require that an entry be made for the field if the required options is checked.  By definition, the fields that comprise the primary key of a table are required fields.

Data Type

Select the data type of the field.

Edit Length

Select the number of characters the user is allowed to enter when entering a value for the field.   For Character fields, this is also the size of the field in the record.  For numeric fields it determines the number of digits a user can enter, but does not affect the size of the field (see Data Types for field sizes).

Decimal Positions

Select the number of decimal positions a Numeric field will have when formatted for output.

Max Size

Enter the maximum size in characters that a Text field can expand to.  If you leave this entry zero, the maximum size will be default maximum size defined by the table file type.  For Ad Hoc table files, this default size is 55,000 characters in a network environment and 64,000 characters on a local computer.  If a table contains more than one Text field, the total maximum lengths of all Text fields cannot exceed these size limits.

Case Control

Select one of the following options:

Case Option	Description

None	The user can enter letters in either upper or lower case and digits.

Upper	All letters entered by the user are shifted to upper case.

Numeric	The user can only enter digits and the following punctuation characters: . / + -

Validation Type

Select a optional validation type for the field:

Type	Description

None	The field is not validated using rules stored in the data dictionary

Range	The field must be between a range of values (inclusive) stored in the data dictionary

Lookup	The field value must equal one of the values stored in a lookup table in the data dictionary

Set	Each character in the field must belong to a set of characters stored in the data dictionary.

In addition to the validation rules defined in the data dictionary, other validations tests are performed by Ad Hoc when the user enters a value for a field:

If the field is required, the user must enter a value for the field

If the field is part of a foreign key described by a link defined for the table, the value a user enters in the field must equal the primary key value of a record in the linked table.  This is, the linked table defined in the link definition becomes a lookup table for the field value.

Note:  If you define a validation code lookup table for a field, you cannot include the "description" you defined for a code value on a form or report.  (It is displayed in combo box controls on a form.)  For example, in the sample database, there is a lookup validation defined for the employee Sex field.  Two codes are defined" M and F.  These codes can be printed on reports, but the descriptions male and female can't.  If you have a field that contains codes, and you want longer descriptions to appear on reports, you must create a database table for the code values and define a link to this table to make it a lookup table for the field.  The ACTMAST table in the sample database that came with Ad Hoc is used in this way.

Edit Button

If a validation type is defined, you can click the Edit button to edit the validation rules.

For Validation Type	the Edit Button will display

Range	Validation Range dialog

Lookup	Validation Codes dialog

Set	Validation Set dialog


Data Types

A database field can have one of the following data types

Type	Description	Size
Character	Fixed-size field of alphanumeric characters	defined by user
Short Integer	Integers between -32,767 and 32,767.	2 bytes
Long Integer	Integers between -2,147,483,647 and 2,147,483,647.	4 bytes
Numeric	A floating point number (whole or fractional) between 1.7 x 10E-308 and 1.7 x 10E308, with 15-digit precision	8 bytes
Date	Dates between 0 AD and 12/31/9999	8 bytes
Text	Variable-size alphanumeric character field	up to 55,000 bytes


Date Field

The following formats are valid for entering dates

mm/dd/yy	You must use the "/" separator

You can enter one of the following codes instead of a date.  You only need to enter the first three letters of each code.

Code	Converted to

today	current system date

yesterday	day before current system date

tomorrow	day after current system date

monday	date of the next Monday after current system date

tuesday	date of the next Tuesday

wednesday	date of the next Wednesday

thursday	date of the next Thursday

friday	date of the next Friday

saturday	date of the next Saturday

sunday	date of the next Sunday

Date output formats

Date output formats that can be specified for data exchange output are shown below using April 16, 1993 as an example.  In the current version of Ad Hoc, the only date format in a report is the default format.

Format code	Date displayed as

Default	The default format set for Ad Hoc (4/16/93 in current version)

yymmdd	930416

yyyymmdd	19930416

mmddyy	041693

mmddyyyy	04161993

ddmmyy	160493

ddmmyyyy	16041993

mmm dd, yyyy	Apr 16, 1993

mmmm dd, yyyy	April 16, 1993

w, mmm dd, yyyy	Friday, Apr 16, 1993

dd mmm yyyy	16 Apr 1993


Validation Range Dialog

Use the Validation Range dialog to define the value range that will be used to validate the data entered into a field.

You can use Range validation for Character, Numeric (including integer), and Date data types.  You can enter a low value, high value, or both.  If you omit the high range value, the field value can be equal to or greater than the low value, and vice versa.


Validation Set Dialog

Use the Validation set Dialog to define the set of valid characters that are allowed in a field of type Character.  The values you enter can be either upper or lower case letters, digits, or punctuation.

Set validation if useful if a field is to contain a set of codes, such as days of the week.  In this case, the valid set might be MTWRFSU, each letter corresponding to a day of the week.  A valid field entry would be MWF.  MWA would be invalid.  Ad Hoc does not currently check for duplicates in the field, so MMWF would also be acceptable.

Case Sensitive

Check the Case Sensitive option if you want upper and lower case letters to be treated as separate characters.  If case sensitive is checked and the valid set is MTWRF, then MtWRF would not be valid.


Validation Codes Dialog

Use the Validation Codes dialog for fields with the Lookup validation type.  This dialog defines the valid values that can be entered into a field, along with an optional descriptive phrase that can be associated with the value.

The Validation Codes dialog contains a list of valid codes, or values, the field can have, followed by an optional description, a longer phrase that describes the code.  For example, a field in an employee record called SEX could have the following codes and descriptions:

Code	Description

F	female

M	male

The Code is the data in the field, the Description is supplied so that a user can understand the codes when entering data into the field.  The Description is optional for validation purposes.

To work with the validation codes dialog:

Click on	or Press	To

Add	Alt-A	Add a code to the list

Change	Alt-C	To change the description of a code in the list

Delete	Alt-D	To delete a code from the list

Shortcut:

Double-click on an entry in the code list to edit it

When you Add or Change a code, Ad Hoc displays the Edit Validation Code Dialog, enabling you to enter a code and description.

Code

A code can be any combination of letters (upper case) or digits, from one to sixteen characters.   You cannot define duplicate codes for a field.

Description

The code description is optional, and there is no practical limit to its length.


Edit Validation Code Dialog

The Edit Validation Code dialog is displayed when you add or change entries on the Validation Codes Dialog.

Code

A code can be any combination of letters (upper case) or digits, from one to sixteen characters.   You cannot define duplicate codes for a field.

Description

The code description is optional, and there is no practical limit to its length.


Define Index Dialog

See Also

Use the Define Index dialog to define an index for a table.  As indexes are added to the table definition, they are assigned a number, starting with 0, in the order you place them in the index list on the Database Table dialog.  Index 0 must be the primary key of the table.

A database table can have up to eight indexes, and each index can have up to eight segments.  However, the total number of segments in all indexes cannot exceed 24.  The total size of the segments in an index cannot exceed 255 bytes.

Dialog Entries

Index Description

Enter a phrase that describe how the index sorts the table.  The description is displayed in cases where the user is selecting a sort order for the table.  Use a phrase like "by Employee ID" or "Alphabetically".

Index Options

Option	Description

Modifiable	Fields that make up the segments of the index can be changed by the use after a record has been added to the table.  Example: if you index the employee table on last name, this allows you to change an employee's last name.

Duplicates Allowed	Records can have duplicate values for the fields that make up the index.  Example: if you index the employee table on last name, this allows two or more employees to have the same last name.

Nulls Allowed	Blanks (null values) are allowed for the fields that make up this index.  If the fields that make up an index are all blank, the record will not appear in the index (it will appear in other indexes).

Note:

The primary key index cannot have any of these options checked.

If a field belongs to an index that is not modifiable, it cannot be changed after the record is added to the table.

If a field belongs to an index that does not allow duplicates, no two records in the table can have the same value for this field.

Segments

The Segments list contains the fields that make up the index.  The Fields list to the right of the segments list shows the fields defined for the table.  Add segments to the index definition from this list:

Click on	or Press	To

Add	Alt-A	Add the field highlighted in the Field list to the end of the Segments list.

Insert	Alt-I	Insert the field highlighted in the Field list before the field highlighted in the Segments list.

Delete	Alt-D	Delete the field highlighted in the Segments list.

Shortcut:

You can double-click on a field in the Field list to add it to the Segments list.  You can double-click on a field in the Segments list to remove it from the list.

Segment Attributes

When a field is highlighted in the Segments list, you can select attributes for this index segment in the Segment Attributes box:

Attribute	Description

Ascending	The index segment is sorted in ascending order.

Descending	The index segment is sorted in descending order.

Case Sensitive	The sort order of the segment is case sensitive.  This means that lower case letters are arranged differently in the sort order than upper case letters.  The range (a-z) follows (A-Z), so that Zoo would come before albatross.  If the sort order is not case sensitive, upper and lower case letters are treated as identical (A and a sort the same).

In most cases, leave this option set off.


Primary Keys and Indexes

Database Table Dialog

Designing Tables


Define Link Dialog

See Also

Use the Define Link dialog to define the links a table has to other tables in the database.  In order to define a link to another table, one or more fields in the table must comprise a foreign key to another table.  That means this field (or fields) must be equivalent to the field (or fields) that make up the primary key of the other table.  Equivalency means the same data type and size.

You should define a link for each foreign key in a table, as links allow you to develop multi-table forms and reports, and also allow for automatic validation of field values, using the linked table as a lookup reference.

Dialog Options

Link ID

Enter a character string identifier of from 1 to 8 characters for the link ID.  No two links in the same table definition can have the same ID.  Use an ID that is descriptive of the link, as the link ID is used as part of the extended field ID of a field in a data view.

Description

Enter a longer descriptive phrase that describes the link, such as "Link to Department Table".

Associated Table

Select the database table that this link is linking to.

Segments in Foreign Key

Add the fields (segments) that make up the foreign key of the associated table.  To the right of the Foreign Key Segments list is the Fields list, showing the fields that have been defined for the table for which the link is being defined.

Click on	or Press	To

Add	Alt-A	Add the highlighted field in the Field list to the end of the Segments list.

Insert	Alt-I	Insert the highlighted field in the Field list before the highlighted field in the Segments list.

Delete	Alt-D	Delete the highlighted field from the Segments list.

Shortcut:

You can double-click a field in the Field list to add it to the Segments list.  You can double-click a field in the Segments list to remove it from the list.

The fields you select for the Foreign Key Segments list must match the fields in the primary key of the associated table exactly in data type and size.


Table Links

Database Table Dialog

Designing Tables

Primary Keys and Indexes


Edit Database Information Dialog

See Also

Use the Edit Database Information dialog to define the characteristics of the database.

Description

Enter a long description of the database 1 to 32 letters or digits.  This helps identify the database in certain situations.  It can be changed if necessary.


Creating a Database

Designing a Database

Changing a Database


New Database Dialog

See Also

The New Database dialog is displayed when you select the Create New Database command.  It enables you to define the ID and directory of a new database.

Dialog Options

Database ID

Enter an identifier for the database.  The Database ID is a combination of one to seven letters (A-Z) and digits.  The ID is used to identify the data dictionary file of the database, the system files, and the reports, lists, and forms defined for the database.

Description

Enter a descriptive phrase up to 32 characters that describes the database.  You can change this description later with the Edit Database Information command.

Directory

Enter a directory into which the database system files will be placed.   Enter the full pathname of the directory, such as: C:\APP\DATA for a directory called DATA that will contain the database system files, which is a subdirectory of a directory called APP located on the C drive.

If the directory you specify does not exist, Ad Hoc will ask you if you want to create it.

Only one set of database system files can reside in a directory.

When you accept the entries in the New Database dialog, Ad Hoc will create a new set of system files and place them in the specified directory.

Browse

Click the Browse button to display the Browse Directories dialog.  This dialog works much like a standard Windows File Open dialog to help to locate a directory in which to place the new database.

Select a drive in the Drives drop down list

Select a subdirectory in the Directories list box

The files in the selected subdirectory are displayed in the Directory Contents list box

Select the All Files  option to see all files in the subdirectory

Select the Ad Hoc Files option to see only Ad Hoc system and table files in the selected subdirectory.


Report Elements Dialog

See Also

Use the Report Elements dialog to work with the elements in a report.

Click on	or Press	To

Add	Alt-A	Add a new element to the end of the elements list.

Insert	Alt-I	Insert a new element before the highlighted element in the list.

Edit	Alt-E	Change the description of the highlighted element in the list.

Delete	Alt-D	Remove the highlighted element from the list.

Cancel	ESC	Close Report Elements Dialog

Shortcut

Double-click on an element in the list to edit its description.


Designing Reports

Designing Report Elements

Understanding Reports


Edit Element Dialog

See Also

Use the Edit Element dialog to change the definition of a report element.

Dialog Options

Description

Enter a description of the element, from one to 32 characters.

Trigger

Select the event during the printing of the report that will cause the element to be rendered.

Region

Select the report region in which the element will be rendered.

Page Break Options

When an element is rendered, it can cause a new page to be started (a page break).  Elements assigned to the Page Header or Page Footer regions cannot cause page breaks.

Option	Description

None	The element will not cause a page break.

Before	A page break will happen before the element is rendered.

After	A page break will happen after the element is rendered.

Set Page to 1	When a page break caused by this element occurs, the page numbering will restart at 1.

Render on break	Selecting this option will cause an element to be rendered at each page break , in addition to its assigned event.

Use this option, for example, if you want to repeat a break header element on every new page.

Fixed Size

Select this option if you want to specify an exact size of an element.  An example of an element that should have a fixed size is the image of a label on a report that prints mailing labels.  If you select this option you must specify:

Measurement	Description

Width	The width of the element, in increments of .001 inch.

Height	The height of the element, in increments of .001 inch.

Left Margin	The left margin within the element, in increments of .001 inch.  The distance between the left side of the element area and the start of text in the element.

Top Margin	The top margin of the element, in increments of .001 inch.  The distance between the top of the element area and the start of text in the element.

If you don't check the Fixed Size option, the width of the element will default to the distance between the left and right report margins.  The height of the element will be determined by the font height and the number of lines of text in the element, plus the top and bottom margin of the element.

Margins

The margins of an element are space between the borders of the element and text that appears in the element.  The margins are determined slightly differently, depending on whether you have selected the fixed size option or not.  All margins are specified in increments of .001 inch.

For fixed size elements, the overall border of the element is fixed, and the margins determine the area available for text or other contents.

For non-fixed size elements, the left and right margins determine indents from the left and right report margins, and the top and bottom margins add extra space before or after an element:

Margin	Fixed Size Element	Non-fixed size
Left	The space between the left edge of the element and the text or other contents	Provides an indent from the left report margin
Right	The space between the element contents and its right edge	Provides an indent from the right report margin
Top	The space between the element contents and its right edge	Adds space before (above) the element
Bottom	The space between the element contents and its bottom edge	Adds extra space below (after) the element
Line Spacing

Select the spacing between lines of text in the element.

If you select	Then

Automatic	Lines will be spaced automatically by the size of the font of text in the line.

Set to...	You must specify a spacing between lines in points.  Specify the distance between the top of a line and the top of the next line.

Font Button

Click on the Font Button to display the Font Selection Dialog, which enables you to select a font for the element.

Use Default Report Font

Select this option to assign the font defined on the Report Layout Dialog instead of a locally defined font for the element.  If this option is selected, changing the report font will change the element font.

Use Common Report Tabs

Select this option to attach the common tabs defined for the report to this element.  All elements with this option selected will share the same report tabs.  When you change a tab setting for one of these elements, you will change it for all of them.

Word Wrap

Normally, when an element is rendered, it is truncated at the right margin of an element, and at the bottom margin if the element is fixed size.

If you check this option, lines within the element will be word wrapped, or broken at the last word boundary before the margin and the rest of the line printed on the next line of the report.  This is particularly useful in paragraph style reports, and when you have included Text fields, which can contain paragraphs of text, on a report.  Any remaining tabs in a line that is word-wrapped are applied against the next tab stop after the new line is started.  This may result in unwanted spacing if you are designing a columnar report.  For this reason, it is best not to place other fields after a Text field on a line, place Text fields on a separate line, or create a separate element for each text field.

If there are tabs in a Text field, they will be spaced according to the tab stops set for the element.

Note: There is an implicit option in Ad Hoc that could be called "Keep Together".  If word wrapping is not turned on, an element will be rendered entirely on the same page.  If there is not enough room for a multi-line element at the bottom of a page, the entire element will appear at the top of the next page.  With the word-wrap option turned on for an element, the element is handled a line at a time, and the implicit "Keep Together" option is turned off.  Therefore, a page break could occur in the middle of an element.

Don't Print Blank Lines

Select this option to suppress the rendering of blank lines in the element.  This is useful for printing address labels, for example, when you have several address lines.  Blank address lines will not show up on the label.


Report Regions Dialog

See Also

Use the Report Regions dialog to work with the regions in a report.

Click on	or Press	To

Add	Alt-A	Add a new region to the end of the elements list.

Insert	Alt-I	Insert a new region before the highlighted region in the list.

Edit	Alt-E	Change the description of the highlighted region in the list.

Delete	Alt-D	Remove the highlighted region from the list.

Cancel	ESC	Close Report Regions dialog

Shortcut

Double-click on a region in the list to edit its description.


Designing Reports

Designing Report Regions

Designing Report Elements

Understanding Reports


Edit Report Region Dialog

See Also

Use the Edit Report Region dialog to change the definition of a report region.

Dialog Options

Description

Enter a one to 32 character description of the region.

Width

Specify the width of the region.  The width options are:

Option	Description

Report margins	The region will extend from the left margin of the report to the right margin.

Fixed width	The region will be the width you specify in increments of .001 inch.

Width of fixed size elements	The region will be as wide as the sum of the widths of the elements assigned to the region that have been indicated as having a fixed size.

Height

Specify the height of the region.  The height options are:

Option	Description

Report margins	The region will extend from the top margin of the report to the bottom margin.

Fixed Height	The region will be the height you specify in increments of .001 inch.

Height of  elements	The region will be as high as the sum of the heights of the elements assigned to the region.

Float between regions above and below	The region will extend from the bottom of the region that precedes it in the regions list to the top of the region that follows it.

Note:  Some of the height and width options are mutually exclusive and some depend on the options of other report regions.  See Designing Report Regions for examples of how to set region size options.

Horizontal Position

For some Region Width options, you must designate horizontal positioning of the region on the report layout.  When you select these Width options

Specify Width

Size Width to Contents

You must specify a distance (offset) of the region from the left or right report margin in inches.  A positive offset measures distance to the right of the left margin or to the left of the right margin.

Vertical Position

For some Region Height options, you must designate vertical positioning of the region on the report layout.  When you select these Height options

Specify Height

Size Height to Contents

You must specify a distance (offset) of the region from the top or bottom report margin in inches.  A positive offset measures distance below the top margin or above the bottom margin.

Repeat Direction

The elements assigned to a region are repeatedly rendered in the region until it is filled.  For example, each time a record is read, an element assigned to the next record event is rendered in its region.  Elements are repeated in a region according to the repeat direction option.

If you select	Then

One column	Elements are rendered from top to bottom in the region, in only one column, regardless of the widths of the region and element.

By rows	Elements are repeated in rows and columns in the region, from right to left for each row, filling a row before going to the next.

By columns	Elements are repeated in rows and columns in the region, from top to bottom in a column, filling a column before going to the next.

The number of elements that fit across or down a region is determined by the size of the region and the size of the elements.  If there is not enough room either horizontally or vertically to render an element in a region, a page break occurs, which "empties" the report regions so they can be filled with new elements.

Border

If you want a border rendered around a region

Select	To print

Left	a line on the left side of the region

Right	a line on the right side of the region

Top	a line along the top of the region

Bottom	a line along the bottom of the region

All	a border around the region

Border Style

Select the style of the borders that you want for the region.


Report Layout Dialog

See Also

Use the Report Layout dialog to define the general characteristics of a report.

Dialog Options

Report ID

Enter a unique ID for the report, from one to eight letters or digits, starting with a letter.  The report ID is used to store reports in the database Reports Table.  Two reports cannot have the same ID.

Description

Enter a descriptive phrase for the report, from one to 32 characters.  This will be used to display reports in selection lists.

Startup Dialog

Select this option if the report will have a startup dialog.  A start-up dialog is displayed before a report is printed to allow the user to enter information used to print the report.

Page Size

Enter the width and height of a page the report will be printed on.  This is the physical size of the page in inches, to the nearest thousandth of an inch.  If the report will be printed on 8 1/2 x 11 paper, for example, enter 8.500 for the width and 11.000 for the height.

Printer Orientation

Select a printer orientation that will be used to print the report.

Orientation	Description

Default	The report will be printed with the orientation that the printer is already configured for.

Portrait

Landscape

Margins

Enter the Left, Right, Top, and Bottom page margins for the report, in inches.

Font

Enter the type face of the font that will be the default for the report.  An element can be assigned this common report font, or can have its own font assigned.

Size

Enter the size of the report font, in points.

Font Button

Instead of entering a type face and size for the font, click the Font Button to display the Font Selection dialog, which enables you to select a font from the fonts installed on your computer.


Label Report Layout Dialog

See Also

Label Measurements

Use the Label Report Layout dialog to design the layout of a labels style report (mailing labels, etc.).  When you begin a new report with the New command on the File menu, and select the label style report, this dialog is displayed in place of the normal Report Layout dialog.

Dialog Options

Report ID

Enter a unique ID for the report, from one to eight letters or digits, starting with a letter.  The report ID is used to store reports in the database Reports Table.  Two reports cannot have the same ID.

Description

Enter a descriptive phrase for the report, from one to 32 characters.  This will be used to display reports in selection lists.

Style

The Style combo box contains a list of pre-defined label styles, plus a selection called "Custom".  To define your own label page layout, select custom.  When you select one of the other styles in this list, most of the label layout parameters are filled in with the specifications for the selected label style.

Startup Dialog

Select this option if the report will have a startup dialog.  A start-up dialog is displayed before a report is printed to allow the user to enter information used to print the report.

Page Layout Orientation

Select a printer orientation that will be used when the report is printed.

Orientation	Description

Default	The report will be printed with the orientation that the printer is already configured for.

Portrait

Landscape

Page Layout Width and Height

Enter the width and height of a page the report will be printed on.  This is the physical size of the page in inches, to the nearest thousandth of an inch.  If the report will be printed on 8 1/2 x 11 paper, for example, enter 8.500 for the width and 11.000 for the height.

Page Layout Left and Top Margins

Enter the Left and Top, margins for the report, in inches.  The bottom and right margins will be computed based on the number of labels and the spacing between labels.

Labels Across and Down

Enter the number of labels across the page and down the page.

Horizontal Spacing

Enter the distance, in inches, between the left edge of one label and the left edge of the next label.

Vertical Spacing

Enter the distance, in inches, between the top edge of one label and the top edge of the label below it.

Label Width and Height

Enter the width and height of a label in inches.  If the labels touch each other on the page, the width and height will be the same as the horizontal and vertical spacing.

Label Margins

Enter the left and right margins within each label, in inches.  The label margins determine the distance of the text on the label from the left and top edges.  You cannot set a right or bottom margin.  If the text is larger than the label, it will extend beyond the edges of the label.

Font Button

Click the Font Button to display the Font Selection Dialog, which enables you to select a font for the labels from the fonts installed on your computer.


Quick Report Setup Dialog

See Also

The Quick Report Setup dialog helps you quickly set up the basic design of a standard report.  This dialog is displayed only once when you start a new report by selecting "Report(Quick Setup)" from the New command on the File menu.  Once the report is setup up, use the commands on the Report menu to make changes or further additions to the design of the report.

The Quick Report Setup dialog creates a standard style of report with:

A page header with a centered title and an area (report element) for column headings

An area (element) for the detail line description

An optional area (element) for a page footer with either the report date, page number, or both

Common tabs for the column heading element and detail line element

Border lines under the page header and above the page footer

On the dialog, you enter the report title, define the fonts for each of the report elements, and select the date and page number options.  After Ad Hoc sets up the basic report, you must  enter the fields and text for the column header line and detail line.  They are initially established to share a common set of tabs, but you must set the tabs.

Dialog Options

Title to Appear on Report

Enter the title to appear on the title line of the report.  This will appear centered at the top of each page of the report.

Fonts

Select the fonts for the Report Title, the Column Headings, the Detail Line and the Page Footer of the report.  These fonts are initially set to the font you defined in the Report Layout dialog.

Date Option

If you select (check) this option, the report will have a page footer element.  The print date of the report will be on the left of the footer line (bottom left corner of each page).

Page Number option

If you select this option, the report will have a page footer element.  The page number will appear on the right side of the footer (lower right corner of each page).


Report Columns Dialog

Use the Report Columns dialog to specify the columns to appear on a Quick Setup report.  This dialog is displayed in a sequence of dialogs during the creation of a quick report.

Report Columns List

Displays the fields selected from the data view that will be the columns of the report

Fields in the View List

Displays the database fields that you defined on the Edit View dialog.

To

Add a field to the columns list	Double click the field in the view list
or
 highlight the field in the view list and press Alt-A or click the Add button

Insert a field at a specified position	 Highlight the entry in the Report Columns List that the inserted field will precede

Highlight the field in the View Fields list that you want to add

Click the Insert button, or press Alt-I

Remove a field from the list	Double-click the field in the Report Columns list
or
Highlight the field in the Report Columns list and click the Delete button or press Alt-D

Clear the Report Columns list	Click the Clear button, or press Alt-C

The Quick Report setup will use the field titles from the database as the initial column headings, which you can change on the report design window.

The initial column tabs are based on the width of the column headings plus .5 inch.  This width will depend on the font you selected for the column headings.


Report Breaks Dialog

See Also

Use the Report Breaks dialog to designate break levels for the report.  This dialog is displayed when you select the Report Breaks command from the Reports menu.

The Dialog lists the fields defined in the sort specification of the report view.  Click on a field to highlight it or to remove the highlighted.  Report breaks will correspond the highlighted fields.


Design Report Breaks


Total Fields Dialog

See Also

Use the Total Fields dialog to work with the total fields of a report.

Click on	or Press	To

Add	Alt-A	Add a total field definition to the report.

Edit	Alt-E	To change the definition of the selected total field.

Delete	Alt-D	To delete the selected total field.

Cancel	ESC	To close the Total Fields Dialog

Shortcut:

You can double-click on an entry in the Total Fields list to edit its definition.


Edit Total Field Dialog

See Also

Use the Edit Total Field dialog to define a total field for a report.

Dialog Options

ID

Enter a descriptive ID for the total field, of from 1 to 32 characters.

Field

Select the designated "target" field in the report data view that the total field will be attached to.  This field should a numeric data type if the total field will be used for Sum, Average, Maximum, or Minimum.

Counter Type

The Counter Type option determines how the value of a total field is changed each time a record is read from the report view while the report is being printed:

Counter Type	Action

Sum	The target field value is added to the value in the counter field.

Count	The value of the counter field is incremented by one.  If the Include Nulls option is not selected, target fields with null values are not counted.

Average	The value of the counter field is the average of the values of the target field in all the records read so far.  If the Include Nulls option is set, target field null values are counted as zero, otherwise they are not included in the average.

Maximum	The value in the counter field is the largest value of the target field in records read so far.

Minimum	The value in the counter field is the lowest value of the target field in records read so far.

Include Nulls

Select this option if you want the total field results to include records for which the designated target field is null.  If this option is not set, null fields will not affect the results in a total field.  If it is set, the field will be counted, but its value will be considered zero.  It will therefore affect Count and Average type total fields.

Clear on Event

Select the report event that will cause the counter to be cleared, or reset to zero.  For a total field that is to include all the records in a report, select the Report Header event to clear the total field when the report starts.


Computed Fields Dialog

See Also

Use the Computed Fields dialog to work with the computed fields of a report.

Click on	or Press	To

Add	Alt-A	Add a computed field definition to the report.

Edit	Alt-E	To change the definition of the selected computed field.

Delete	Alt-D	To delete the selected computed field.

Cancel	ESC	To close the Computed Fields Dialog

Shortcut

You can double-click on an entry in the Computed Fields list to edit its definition.


Edit Computed Field Dialog

See Also

Use the Edit Computed Field dialog to define a computed field in a report.

Dialog Options

Identifier

Enter a descriptive string of from one to 32 characters that identifies the field.

Equivalent Field

The Equivalent Field combo box contains a list of the database fields defined for the report.  Selecting one of these fields is a quick way of setting the field characteristics (Data Type, Edit Length, Decimal Places, and Case Control) of the computed field you are defining.

Select "-none-" if you want to define the characteristics of the computed field yourself.

Select a field ID from the list if you want to set the computed field characteristics equal to the selected field's characteristics.

Data Type

Select the data type of the field.

Edit Length

Select the number of characters the user is allowed to enter when entering a value for the field.   For Character fields, this is also the size of the field.  For numeric fields it determines the number of digits a user can enter.  The edit length is used if you place this field on a report startup dialog.

Decimal Places

Select the number of decimal positions a Numeric field will have when formatted for output.

Case Control

Select one of the following options:

Case Option	Description

None	The user can enter letters in either upper or lower case and digits.

Upper	All letters entered by the user are shifted to upper case.

Numeric	The user can only enter digits and the following punctuation characters: . / + -

Expression

Enter the expression that is used to compute the field value.  See Field Expressions.

Compute on Event

Select the event that will cause the field value to be computed according the field expression.  In the current version of Ad Hoc, field values are computed only when the report starts (Report Header Event), before the startup dialog is displayed.  Therefore, the field expression can contain a suggested default value, and the user can override it when the report is started.


Field Expressions

The current version of Ad Hoc does not support field expressions except for constant values.  The constant value that you use for  a field expression must be compatible with the data type of the field.


Report Field Types

The types of report fields that can be defined for a report are:

Field Type	Description

Standard Fields	Built-in report fields that include Page, Date, and Time.

Database Fields	Database fields are fields defined in the report view (See Data View Command).  The report field name is an "@" sign followed by the short field ID of the field.  (If the field is from a linked table, the link prefix is not used).  If two fields in the view have the same field ID, a "1" is appended to the name of the second field.

Total Fields	Total fields are defined with the Total Fields command.

Computed Fields	Computed fields are defined with the Computed Fields command.


Report Fields Dialog

Use the Report Fields dialog to select a field to be inserted on a report layout at the position of the blinking edit cursor.  This dialog is displayed when you select the Insert Field command.

The Report Fields dialog contains a list of all the fields defined for the report.  Below the list is displayed a description of the field selected in the list.  This description includes:

Field Type	Description includes

Standard Fields	Description of the field

Database Fields	The extended field ID from the report view

The field description from the data dictionary

Total Fields	The computation type of the field

The database field whose value is being computed

Computed Fields	The characteristics of the field

The expression


Report Display Window Options Dialog

Use the Report Display Window Options dialog to change the viewing and other options for report display windows.  You can display this dialog by selecting the Options command on the Report Display Window menu.

Note: when you change these options, they are stored in the Ad Hoc initialization file, and will apply to every report display window that you open after you change the options.

Dialog Options

Report Page Height

There are two options for report page height:

Select	To

As Designed	Generate the report with a page height equal to that specified when the report was designed.

Fit Window	Change the height of the report page to equal the height of the display area of the report display window.  The height of the window when the report generation starts is used.  If you subsequently change the window size, the page size of an already generated report is not changed.  If you change this option after the report is generated, you have to use the Restart command to regenerate the report with a new page size.

Magnification

The magnification options set the scaling of the report in the display window.  Using a smaller magnification zooms out so that more of the report is visible in the same area.  Using a larger magnification zooms in so that the output of the report looks larger, but you see less of it.

Select	To

Fit Window	Set the magnification so that an entire page of the report can fit within the report display window.  This option is not available if you have set the "Fit Window" Page Height option.

Custom	Specify the magnification amount, from 10 percent to 200 percent.

Store Pages on Disk

As a report is generated, the image of each page is stored in memory.  Each page image could require 5,000 to 6,000 bytes for moderately complex pages of text, and possibly more for very complex output.  If you have a large report to view, and limited RAM in your computer, you can select the Store Pages on Disk option to store the page images in temporary files on disk rather than in memory.  Each page is stored in a temporary file with a name like: ~MFxxxx.TMP.  These files are stored   If you have a TEMP environment variable specified, these files will be placed in the directory specified in that environment variable, otherwise they will be placed in your Windows directory.  When the report display window is closed, or a new report is generated, these temporary files are removed.  Don't select this option for the fastest report generation and display speed.


Report Selection Dialog

Use the Report Selection dialog to select a report from the database.  Use the up and down arrow keys to highlight the desired selection, or just click on it with the mouse.  Then press the Enter key, click the OK button, or double-click the left mouse button to select the highlighted entry.

The list box in this dialog is an Ad Hoc list, which means that you can use Ad Hoc keystroke navigation to highlight an entry.


Tables Window

See Also	Procedures

The Tables Window displays a list of the tables defined for the current database.  The tables are displayed alphabetically by Table ID.  This list also displays the description of the table, its file status, and the number of records in the table.  When the Tables Window is displayed, you can use the commands on the Tables menu to change table definitions and maintain table files.  Some of these commands also appear on the Table Window fastmenu, that pops up when you press the right mouse button when the cursor is over the Tables Window.

Note: to use the fastmenu, first select the table you want to work with by pressing the left mouse button, then press the right button.  The right button will not change the table selection.

You cannot edit or rebuild tables while a form, list, or report window is open on the desktop.

The file status of a table displayed in the Tables Window is one of the following:

Status	Meaning

OK	The file exists and its status is normal.

No File	The file could not be found.  Ad Hoc looks for a file with the name specified in the table definition.  If there is no pathname specified in the table definition, Ad Hoc assumes the file is in the directory assigned to the database when it was created.  This is the current working directory when the database is opened.

Error in File	An error was encountered in opening the file.  The file must either be rebuilt, or if that is not possible, restored from a backup.  If all files contain this error code, there is a system problem.  In this case, before rebuilding, first close all your applications, reboot your system, and open Ad Hoc again.

The tables containing  data in the database are shown in black.  System files are shown in blue.  If the table file could not be found, the table is displayed in red.

The system tables are:

Table ID	Description

_DDDATA	Contains data dictionary information, including validation rules for database fields.

_FORMS	Contains form and list designs, and saved desktop layouts.

_REPORTS	Contains report designs.


Creating a New Database

Designing a Database

Changing a Database Design

Adding Tables

Designing a New Table

Editing Table Definition Command

Database Maintenance

Understanding Databases


The title bar of the Tables Window displays the pathname/id of the database.  (this is the same as the pathname/filename of the data dictionary file, minus the .ddf suffix).


The ID column displays the ID of the database tables.  The tables are sorted in the list by ID.


The Description column displays the Description of the database tables entered on the Database Table dialog.


The Status column shows the file status of each database table.


The Records columns shows the number of records in each database table.  For the _FORMS table, this is the number of forms, lists, and desktop layouts stored in the file.  For the _REPORTS table, it is the number of report designs.


Forms

Form Window

Form Control Pad

Using Forms

Displaying Forms

Entering Data on a Form

Using a Form Scroll Region

Using a Form Search Window

Designing Forms


The Form Window
Form Window

See Also	Procedures

Click on an object in the above graphic to view a short description.


Using Forms

Displaying Forms

Entering Data on a Form

Using a Form Scroll Region

Using a Form Search Window

Designing Forms


Using Forms

A form is a desktop object that displays fields from the database one record at a time in a layout format similar to a paper form.  A form is used to enter and change data in the database as well as view it in a custom format,  You use a form very much the same way you use a standard Windows dialog box.  A form contains objects called controls that display the contents of data fields.  The three types of controls on a form are:

Control Type	Description

Edit Control	A one-line control for entering and editing fields of type.

Text Box	Similar to a Windows dialog multi-line edit box.  A text box can contain more than one line of text, and is used to display and edit fields of type Text.

Combo Box	Similar to a Windows dialog combo box.

Each form control corresponds to a field in the data view associated with the form, and when you change the information in the box and then accept the change, you have changed the field in the database.  If you discard the changes you make on a form, the changes are not made in the database.

See	For help on

Form Window	An overview of  a form and its various components

Displaying Forms	Displaying and putting away forms

Entering data on a form	Making changes to the data displayed on a form

Using a Form Scroll Region	Working with forms that contain scroll regions

Using a Form Search Window	Selecting a record from the data view to display on a form


Displaying Forms

To open a form and display it on the desktop:

1.	Select the Open command on the File menu to display the Open dialog.

2.	Highlight the name of the form you want to open, by clicking it or using the up or down arrow to highlight it.

3.	Click the OK button, or press ENTER.

You can also just double-click on the name of the form to open it.

To put away a form

Make sure the form is the active form.  Then do one of the following:

Select the Close command on the File menu.

Double-click the system menu icon in the top left corner of the form.

Click the system menu icon to display the menu, the select the Close command.

To close all the open forms (and other desktop objects), select the Close All command on the Window menu.


Control Pad
Form Control Pad

See Also:  Form Design Control Pad

The form's control pad is displayed at the top of the form.  The control pad contains icons representing control functions for the form.  When you click the left mouse button on an icon, it sends a command to the form.  Some of these icons may not appear, depending on the status of the form.

Click on an icon in the above graphic to view its function, alternate keystroke command, and alternate menu command.


First Record

Click this icon on a form control pad to display the first record from the form's data view.  The first record is determined by the current index selected in the search window, or the current sort order.

Keystroke Equivalent:	Ctrl-F

Form menu command:	First


Previous Record

Click this icon on a form control pad to display the previous record from the form's data view.  The record order is determined by the current index selected in the search window, or the current sort order.  If you hold the left mouse button down on this icon, the Previous command will start repeating until you release the mouse button.

Keystroke Equivalent:	Ctrl-P

Form menu command:	Previous


Next Record

Click this icon on a form control pad to display the next record from the form's data view.  The record order is determined by the current index selected in the search window, or the current sort order.  If you hold the left mouse button down on this icon, the Next command will start repeating until you release the mouse button.

Keystroke Equivalent:	Ctrl-N

Form menu command:	Next


Last Record

Click this icon on a form control pad to display the last record from the form's data view.  The last record is determined by the current index  selected in the search window, or the current sort order.

Keystroke Equivalent:	Ctrl-L

Form menu command:	Last


Search for a Record

Click this icon on a form control pad to display the search window.  If no search window has been defined for the form, this icon will not appear on the control pad.

Keystroke Equivalent:	Ctrl-S

Form menu command:	Search


New Record

Click this icon on a form control pad to prepare the form for entering a new record in the database.  If the form does not allow the entry of new records, this icon will not appear.  It also does not appear when the form is in design mode.

Keystroke Equivalent:	Ins (Insert key on the keypad)

Form menu command:	New


Delete Record

Click this icon on a form control pad to delete the current record.  Ad Hoc will ask you to confirm the deletion.  If the form does not allow deletion of records, this icon will not appear.  It also does not appear when the form is in design mode.

Keystroke Equivalent:	Ctrl-D

Form menu command:	Delete


Update Record Changes

Click this icon on a form control pad to accept the changes you have made on the form.  This icon appears if a change has been made on the form.

Keystroke Equivalent:	Enter key

Form menu command:	Update


Cancel Record Changes

Click this icon on a form control pad to discard the changes you have made on the form.  The record will not be updated and the form will be restored to its values before you began the changes.

Keystroke Equivalent:	Esc key

Form menu command:	Cancel


Lookup Field Value

This icon appears when the form control (field) with the current focus has a value that can be looked up in another table or has a validation rule defined in the data dictionary.  Click this icon to open the lookup window and select a value for the field.

You can also click the right mouse button in the data area of the control to view the lookup window.

Keystroke Equivalent:	Ctrl-<up> (hold the Ctrl key down and press the up arrow key)

Form menu command:	none


The form title bar displays the name of the form (the description you entered when designing the form is used for the name in the title bar.).  You can click and drag the title bar to move the form on the desktop.

When a form is in design mode, the word "Design" precedes the name of the form.  When a form is sorting, or linked to another form, that is also indicated in the title bar.


Entering Data on a Form

To edit (make changes to) a record in the database

To edit a record in the database, make sure the correct record is displayed on the form:

Use the search window to find the record, or use the Next Record or Previous Record commands to locate the record.

 Move to the control that contains the data you want to change.  You can do this by:

Pressing the Tab key to move from one control to the next

Pressing Shift-Tab to move backwards from one control to the next

Click the left mouse button on the control

Edit controls and text boxes

To make a change to an edit control or a text box, position the cursor in the control at the point in the text where you want to make the change, then type in your change.

Press the backspace key to delete the character to the left of the cursor

Press the Del key to delete the character to the right of the cursor

Hold down the left mouse button and drag the mouse across a selection of the text you want to highlight.  When a selection is highlighted, the next character you type will replace the highlight (the backspace and Del keys will delete a selection).

When you enter a change on a form, the update and cancel icons will appear on the control pad.  Change as many data items as you want, then press the Enter key or click on the update icon to accept your changes and update the information in the database.  To discard your changes, press the Esc key, or click on the cancel icon.

Line breaks and tabs in text boxes

Since the Tab key and the Enter key are used to control a form, use these key combinations in a text box:

To insert a tab character into a text box, hold the Ctrl key down and press Tab

To start a new line in a text box, hold the Ctrl key down and press Enter

Combo boxes

Instead of typing data into a combo box, you select a value from a list of values in the combo box.  A combo box normally displays the selected value of the field.  To see the list of values and select a new value, you display the drop down list of the combo box.

To select a value from the combo box list,

Click the arrow icon on the combo box to display the list, then click on the desired entry.

Type the first letter of a value in the list to select it.  The list does not have to be displayed.  If several entries have the same first letter, successively typing the letter will select the items in order.

For fields that are required (not allowed to be blank) the combo box contains only the list of valid values.  For fields that can be blank (have null values), there is an extra entry in the list designated as "n/a".  This corresponds to a null value, and selecting this entry in a combo box is the same as leaving an Edit control blank.

Accepting the changes

When you try to leave a form control, either by tabbing, clicking on another control, or accepting the changes to the form, Ad Hoc will validate the contents of the control.  If the information you entered into the box is invalid, Ad Hoc will not let you leave the control.  Instead it will beep and display a message in the status bar.  If this happens, simply retype your entry with a valid value for the field.

To add a new record on a form

1.	Use the New Record command to blank the form.

2.	Enter the field values for the new record

3.	Accept the new record with the Update Record Changes command

To discard the new record without adding it to the database, use the Cancel Record Changes command.

You can add a new record on a form only if the Add permission was specified in the form design and all the required fields in the root table of the form's data view are on the form.  For new record to be accepted, the field or fields that make up the primary key of the root table must not duplicate the key of a record already in the table.

To delete a record

Make sure the form is displaying the correct record, then use the Delete Record command to delete the record.  Ad Hoc will ask you to confirm the deletion.  You can delete records on a form only if the Delete permission was specified in the form design.


Using a Form Scroll Region

A scroll region is an area on a form that contains an imbedded list.  This list operates like a standard list object (See Using Lists), except that its data view is usually linked to the parent form so that the records displayed in the list have some relationship to the records on the parent form.

When a form with one or more scroll regions is first displayed, the form is active, which means that pressing the Tab key will move you from control to control on the form.

To activate the scroll region

Press the F6 key to activate a scroll region, or click on the scroll region with the mouse.  When a scroll region is active, pressing the Tab key will move the input focus among the controls of the scroll region.

Successively pressing F6 will move the active focus between the scroll regions and the form.  You can also reactive the form by clicking on any control on the form (except scroll regions and display-only controls).

Editing records displayed in the scroll region

If the scroll region has a pop-up edit form (see Using Lists), you can use the following commands when the scroll region is active:

To	Do this

Add a new record	Press Alt-A, or
Click the left mouse button on the Add button

Edit a record	Highlight the record in the list by clicking on it or using the arrow keys, then
Press Alt-E, or
Click the left mouse button on the Edit button, or
Double-click on the record in the list

Delete a record	Highlight the record in the list, then
Press Alt-D, or
Click the left mouse button on the Delete button
Ad Hoc will ask you to confirm the deletion


Using a Form Search Window

The search window of a form is a list attached to the form that pops up to display the records from the form's data view in a list (row and column) format.  You can use the search window to browse through the records and select a record to load into the form for editing.

If the form has a search window, you can use the search icon on the control pad to display the search window.

Click on an area of the above graphic to see a short definition.

Selecting a Record from a Search Window

To select a record from the search window, click on the entry in the search list, or use the arrow keys to highlight the entry.  Then click the OK button or press the ENTER key.  You can also just double-click on the entry to select a record.  The search window will close and the selected record will be displayed on the form.

If you want to close the search window without selecting a record, click the Cancel button, or press the ESC key.

Changing the order of records in the search window

Use the sort control at the top of the search window is a combo box that enables you to select the sort order of records in the list.  To display the drop-down list of the combo box, click on the combo box.  Select the sort order displayed.  The entries in the sort list will include:

All the indexes defined for the root table of the data view.  Each of these entries will include the index number and description.

The sort defined for the data view, if one was defined.  This entry will include the IDs of the fields in the sort specification, if one was defined for the form's data view.

When you select a sort, the names of the fields that define the sort will be displayed after the search control (see below).

Searching for a Record

You can use the search control on the search window to search for a particular record in the list.  See List Search Control for help.  When you have found (and highlighted) the record you want to edit,  press ENTER or click the OK button to hide the search window.  The record will be displayed in the form.  If you do not want to select a record from the search window, click the Cancel button or press the Esc key.


Click the OK button (or press the ENTER key) to select the record highlighted in the list and display it in the form for editing.


Click the Cancel button (or press the ESC key) to close the search window without selecting  record.


Using Lookup Windows

A lookup window is a window that is available for certain controls on a form to enable you to scroll through a list of valid values for the control, and select one from the list.  If a field on a form is part of a link between the form's root table and another table, the link can be used to look up valid values for that field, and Ad Hoc will automatically validate any value you enter for the field.  The link is also used to fill out a lookup window that you can pop-up to see a list of all possible values for the field.    An example in the sample database is the Department field on the Employee form.  When you move the cursor to this field,  you will see the lookup icon appear on the control pad, indicating that a lookup window is available for the Department field.

Lookup icon

Whenever the input focus is on a field that can be validated using a relationship between tables, a lookup icon appears on the form's control pad.  You can click on this icon to show the lookup window.  You can also click the right mouse button on the field or hold the Ctrl key down and press the up arrow key to display the window.

A lookup window acts just like other lists, such as the form's search window.  You can change the sort order of the records displayed to any of the indexes defined for the lookup table.   When you select an entry from the lookup list, the fields in the table's primary key are pasted into the corresponding fields (foreign key fields) on the form.  In our sample database, the Department ID from the Department table is entered into the Department field on the employee record.

To select an entry on the lookup table, highlight it and click the OK button, or just double-click it.

If you don't want to select an entry, click the Cancel button.

When you use a lookup window for the first time after opening a form, it will have approximately the same size as the form.  This may not be large enough to see all the columns or many of the rows in the lookup list.  To re-size the lookup window, drag its border with the mouse.  It will always open in the top left corner of the form, but it will stay the size you make it until the form is closed.   Lookup window settings are not saved when a form is saved or from one use of the form to the next.  Similarly, the sort order of the lookup window will always initially be index 0 of the lookup table, but you can change this order like any other list.

See Designing Lookup Windows for information about specifying the fields that appear in a lookup window.

Other Types of Lookup Windows

The lookup icon is also displayed for fields that have validation rules in their definitions in the data dictionary (entered when you designed the table from the Tables Window).  For fields that have a Lookup validation type, a lookup dialog is displayed listing the valid values and their descriptions.  You can select a value in the same way as described earlier.  Of course you can also use a combo box control for these types of fields.  The lookup window is displayed only if you use an edit control instead.  For fields that have range or set validation rules, a dialog pops up displaying the rules; you have to enter a value yourself.


Linking Forms on the Desktop

Examples

You can link forms or lists open on the desktop so that when you view a record on one form it determines the records that can be viewed in the linked form.  The controlling form (or list) is called the master and the form or list linked to it is called the slave.  You define a link between two forms or lists by defining matching fields in the data views of the two forms.  This creates, in effect, a filter for the slave form or list.  The slave form or list can display only records with link fields that match (equal) the corresponding link fields in the master.

If the slave form already has a filter defined in its data view, the effects of the link filter are added to it.  For example, you can link a slave employee list to a master department form, and additionally filter the employee list for employees hired after a date.

Creating Form Links

Use the Form Links command on the File menu or the Form menu of the master form,  The master form must be the active form when you define the link, and the slave form must be open on the desktop.

See Form Links Dialog and Edit Link Dialog for help on describing the link.

Procedures:

Link a form to another

Unlink a form from another

Saving Form Links

Form links are saved when a desktop layout is saved.


Examples of linking forms and lists
Examples of linking forms and lists on the desktop

Examples of linking forms that you can try with the sample database that came with Ad Hoc:

Linking a list to a form

Linking a form to a list

Linking a form to another form


Linking a form to a list

You are editing department records on the Department Master form, and when a department record is viewed on this form, you want to see a list of phone numbers for the employees in this department.

Open the Employee Phone List list.

On the Department Master form, use the Form Links command to link it as the master to the Employee Phone list as the slave, by matching the DEPT field of the Employee Phone LIst to the DEPTID field of the Department Master form.

When you view a record in the Department Master form, only employees from that department will appear in the Employee Phone List


Linking a list to a form

You are viewing records on the Employee List, you want to see information on each employee's department.

Open the Department Master form

On the Employee List, use the Form Links command to link it as the master to the Department Master form as the slave, by matching the DEPTID field of the Department form to the DEPT field of the Employee List.

When you highlight an entry in the Employee List, that employee's department record is displayed on the Department form.

(Note: "Master" in the department form name means "the master record of department information", and is not related to the term "master form of a link")


Linking a form to a form

You are editing information on the Employees form, and at the same time want to edit employee address information, which appears on the Employee Home Addresses form.

Open the Employee Home Addresses form.

On the Employees form, use the Form Links command to link it as the master to the Employee Home Addresses form as the slave, by matching the EMPID field of the Employee Home Addresses form to the EMPID field of the Employees form.

When you view a record on the Employees form, the address record for the same employee will appear on the Employee Home Addresses form.


Form Design Window

See Also 	Procedures

Click on areas in the below picture of a form in design mode for brief explanations.


Search Icon

Click this icon when the form is in design mode to display and design the search window.  A search window is designed just like a desktop list.


An edit control click the right mouse button on a form control in design mode to display the control attributes dialog.


A selected control has a dotted selection rectangle displayed around the data entry area of the control and the title.  Click anywhere in this area with the left mouse button to select the control and drag it with the mouse.  Click the right mouse button to display the attributes dialog.


A scroll region with an embedded list.  Click the right mouse button on the list to display its design menu.  An embedded list is designed just like a desktop list or search window.


List scroll bar.  Click and drag the left mouse button on the tabs to change the column positions.  Click the right mouse button on the tabs to display the tab menu to change the tab alignment type.


List Edit button.  If the list has a pop-up edit form, the Add, Edit, and Delete buttons will appear.  Click on the Edit button (or Add if it is not grayed) to display the pop-up edit form for design.  The design of an pop-up form layout is like the design of a desktop form.


Align Left

Aligns the selected controls in the horizontal direction so that the left edges of their data entry areas are lined up vertically.  Titles are ignored for the alignment.


Align Right

Aligns the selected controls in the horizontal direction so that the right edges of their data entry areas are lined up vertically.


Align Top

Aligns the selected controls in the vertical direction so that the top edges of their data entry areas are lined up horizontally.


Align Bottom

Aligns the selected controls in the vertical direction so that the bottom edges of their data entry areas are lined up horizontally.


Space Equally Vertically

Moves the controls vertically so that they have equal spacing between them in the vertical direction.  The top and bottom controls in the selection are not moved.


Space Equally Horizontally

Moves the controls horizontally so that  they have equal spacing in the horizontal direction.  The leftmost and rightmost controls in the selection are not moved.


Grow to Largest Width

Re-sizes the selected controls to the width of the widest control in the selection.


Shrink to Smallest Width

Re-sizes the selected controls to the width of the control with the smallest width in the selection.


Defining Data Views

Designing Form Controls

Form Design Control Pad

Arranging Controls on a Form

Aligning Controls on a Form

Designing a Scroll Region on a Form

Designing A Form Search Window

Designing Lookup Windows


Form Design Control Pad

See Also:  Form Control Pad

The form's design control pad is displayed at the top of the form in design mode.  When you click the left mouse button on a control pad icon, it sends a command to the form.

Click on an icon in the above graphic to view its function, alternate keystroke command, and alternate menu command.


Designing Forms
Designing Forms - Overview

See Also	Procedures

Steps in designing a form

1.	Determine what information you want to appear on the form and how the form will be used.  Determine the data view for the form.  The form will usually be closest associated with a particular table, most of the fields on the form will be from this table.  This table should be the root table of the view.  Fields from other tables can be included to provide additional information on the form, but only fields from the root table can be changed on the form.

2.	Decide on a preliminary layout of the controls on the form.

3.	Select the New command on the File menu, then select Form from the list of objects.  This will display a new, empty form on the desktop in design mode.

The following steps are performed by selecting commands from the Form Design menu, which you display by clicking the right mouse button when the mouse cursor is over the form ( if the form is not the active window, click it with the left button first), or by pressing Alt-M when the form has the focus.

1.	Define the basic attributes of the form by selecting the Form Attributes command on the Design Menu to display the Form Attributes Dialog.

2.	Define the data view for the form by selecting the Data View command on the Design menu to display the Edit View dialog.    The data view includes the database fields associated with the form, the record sort order, and the record filter rules.  Note: a form that has a sort order that is not an index of the root table can't be used to add or delete records.  (See Defining Data Views.)

3.	Place a control for each field in the data view that you want to appear on the form.  You can use the Quick Layout command (see Quick Form Layout dialog) to quickly create a standard layout of selected controls, or you can create each control individually with the New Edit, New Combo Box, and New Text Box commands.

4.	Set the tab order of the controls.

5.	Select the colors for the form with the Colors command (see Colors dialog).

6.	Select the fonts for the form with the Fonts command (see Fonts dialog).

7.	If the form has a search window, design the search window (see Designing a Form Search Window).

8.	If the form has an attached data exchange template, design the template (see Designing Data Exchange Templates).

9.	Set the size of the form by dragging its borders with the left mouse button.  The size of the form is saved with the design.  The size of a form can be changed only when the form is in design mode.

10.	Move the form to the position on the desktop where you want it to appear when it is first opened.  Move the form by dragging its title bar with the left mouse button.

11.	Leave design mode by selecting the Leave Design Mode command on the Form Design menu.

12.	Select the Run Diagnostics command, either on the Form menu (when not in design mode) or the Form Design menu (when in design mode), to check the design of the form.  (See Diagnostics);

13.	Save the form design by selecting the Save command on the File menu.

Once a form design has been saved, you can display it on the desktop by selecting the Open command on the File menu.

To make modifications to a form design

1.	Display the form on the desktop

2.	Select the Design Mode command from the Form menu

3.	Make the desired changes

4.	Leave design mode by selecting the Leave Design Mode command on the Form Design menu

5.	Save the form design with the Save command on the File menu

To delete a form design from the database

Select the Delete command on the File menu

Select the form design you want to delete from the list of forms and other desktop objects

Click OK or press ENTER.  Ad Hoc will ask you to confirm the deletion.

Design Considerations

To use the form for	Make sure that

Editing records	The Edit Records option is checked on the Form Attributes dialog.

Adding new records	The Add New Records option is checked on the Form Attributes dialog, and that the form contains a control for each required field in the root table.

Deleting Records	The Delete Records option is checked on the Form Attributes dialog.

Importing/Exporting Data	You have designed a data exchange template appropriate for the import and/or export operation.


Form Design Window

Defining Data Views

Designing Form Controls

Arranging Controls on a Form

Aligning Controls on a Form

Designing a Scroll Region on a Form

Designing A Form Search Window

Designing Lookup Windows


Defining Data Views

See Also

Data Views are associated with forms, lists, and reports, and define the data from the database that will appear on the form, list, or report.  A data view is a collection of fields from one or more tables of the database.  In this respect, a view is like a table, except that its records are not stored physically in a file that corresponds to the view.  Instead, the records in a view are built  dynamically, as they are read from the view, from data fields stored in the database tables.  Using views, a form or report can work with data that is gathered from several different tables in the database.

In addition to the fields, a view definition consists of a sort specification, which defines the sort order of the records in the view, and a filter definition, which determines which records from other tables are selected to provide data for the view.

See Edit View Dialog for specifics of using this dialog to enter a view definition.

Root Table

The primary table supporting the view is called the root table.

Only fields from the root table can be changed on forms, fields in the view supplied by other tables can only be displayed.

The pre-defined indexes of the view are the indexes of the root table.

The view can include fields from tables other than the root table if the tables are related to the root table through one or more links defined in the root table definition.

The use of the form or report using the data view will usually make the choice of the root table obvious.  If you are designing a form to enter employee data into the database, for example, the Employee Table will be the root table.  In general, if you are defining a view based on two tables that are related by a link defined in one table, the table with the link definition should be the root table.

Fields

The fields of a view can be any field from the root table, or from any table that can be reached from the root table by a link.  You can select fields from tables that are not linked directly to the root table, but are linked to a table that itself is linked to the root table.  A field is specified in a view definition by its extended field ID.

Fields to include depend on the object the view is attached to:

Object	Fields to Include

Form	All the fields that you want to display in controls on the form.  If the form is to be used to add new records, you must include all required fields of the root table.  If additional fields will be used to define the sort specification or filter, these must also be included in the view definition.

List	All the fields that will be displayed in the list columns, and (if the list has been designed with a pop-up edit form) all the fields that will appear on the edit form.  If additional fields will be used to define the sort specification or filter, these must also be included in the view definition.

Report	All the fields that will appear in the report layout, fields that will be used in the definitions of computed report fields, and fields that will be used in the definitions of the view sort specification and filter.

Sort Specification

The sort specification consists of a list of fields that define the sort order of records.  Records are sorted by the values of the fields in the sort order.  Each field can be sorted in either ascending or descending order.  Any field in the view can be used in the sort specification.

If you specify a sort order that is also an index of the root table, the root table index is used to retrieve records.  Otherwise, each time the view is opened, its records must be sorted using a temporary sort file.  If you have a sort order that is used frequently for a report, form or list, define an index for it in the definition of the view's root table so you won't have to wait for the records to be sorted each time you open the view.

Sorts for Forms

Forms that have a sort defined in the view that is not an index of the root table of the view can't be used to add or delete records.  They can be used to display information or to edit records.  If you specify a sort that matches a root table index, that index will be used to sort the form, and you can then add or delete records.  However, it's best not to specify a sort for a form at all.  Instead, add a search window to the form and give it an index control.  This allows you to change the sort order of the form to any of the root table indexes while you are using the form.

Sorts for Lists

If a list will be used to edit records (has the AddEditDelete style) the same restrictions apply to its sort order as discussed above for forms.  If you specify a non-index sort for a list, the records displayed in the list will have to be sorted each time you open the list.  If a list has a non-index sort, you can still use an index control on the list and choose between the non-index sort specified in the view definition, or any of the indexes of the root table.

Sorts for Reports

You must specify the sort order you want in the view definition of a report, even if it matches an index of the root table.  If you don't define a sort order, the primary key index will be used.  If you specify a sort order that is an index of the root table, the index is used when the report is printed, otherwise the records will be sorted before the report prints.

Filter

The filter of the data view determines how records are selected from other tables to make up the records of the view.  A filter selects records based on whether or not the values of specified fields in a record pass the comparison rules defined in the filter.  In the current version of Ad Hoc, only fields from the root table can be used to define a filter.  If no filter is defined for the view, each record in the root table will generate a record in the view.

If you define a filter for a form (or a list that has the AddEditDelete style), you can only edit or delete records that pass the filter rules.  You can add a new record that doesn't pass the filter rules, but once you add it, you can't access it on the form unless you change the filter rules to include it.


Data View

Introduction to Databases

Edit View dialog.

Sort Specification Dialog

Filter Rules Dialog

Edit Filter Rule dialog

Extended Field ID


Extended Field ID

The extended field ID is used to identify the fields in a data view.  Within its table, a field is identified by the ID you specified on the Define Field dialog.  Since fields from different tables can have the same ID, the ID alone is not enough to specify a field in a view.  The table ID and field ID are still not enough, since the same field can be included in a view more than once through different table links.  To identify a field and its context within the view, the extended field ID contains the IDs of the links used to link the field's table to the root table along with the ID of the field.   The link IDs and Field ID are separated by a period:

LINKID1.LINKID2.FIELDID

Example:

For an example based on the sample Ad Hoc database, take the data view specified for an employee report.  The view including fields from the Employee table (EMPID, LNAME, FNAME and DEPT) and  fields from the Department table (DEPTID, NAME, LOC).  The primary key of the Employee table is EMPID and the primary key of the Department table is DEPTID.  The Employee table is linked to the department table by a link with the ID DEPTLNK.

The root table of the view is the Employee table.  The following extended field IDs describe the fields in the view.  Fields from the root table have no link prefix.

Field ID	From Table	Extended Field ID	Description of the field
EMPID	EMPLOYEE	EMPID	The id of the EMPID field in the root table of the view
DEPT	EMPLOYEE	DEPT	The department in which the employee works
NAME	DEPT	DEPTLNK.NAME	The name of the department in which the employee works
LOC	DEPT	DEPTLNK.LOC	The location of the employee's department


Designing Form Controls

See Also

The process of laying out a form consists of placing a form control on the form for each field in the data view that you want to display and optionally edit on the form.  To define or modify controls on a form, the form must be in design mode.

Control Type	Can be used with fields of type

Edit Control	Character, Integer, Numeric, Date

Combo Box	Character, Integer, Numeric, Date which have a validation type of Lookup

Text Box	Text

Quick Form Layout

To quickly lay out a number of edit controls on a new form, use the Quick Layout command on the Form Design menu.  (See Quick Form Layout dialog).

Placing a Control on a Form

Select one of these commands from the Form Design menu:

Selecting	Will display

New Edit	Edit Control Attributes dialog

New Combo Box	Combo Box Attributes dialog

New Text Box	Text Box Attributes dialog

1.	Use the dialog to define the field attached to the control, and other attributes of the control, the click the OK button, or press the ENTER key.

2.	The dialog is closed and the shape of the cursor is changed to a cross

3.	Move the cursor to the position on the form where the upper left corner of the control (not including its title) is to be placed

4.	Click the left mouse button to place the control

Once a control is placed on a form, you can use the layout icons on the control pad to move them to the correct position and size them.

Changing the Tab Order of Controls

The tab order is the order that you move from control to control when you press the Tab key.  (Pressing Shift-Tab moves you in reverse tab order).  The tab order should be the order you want to fill out the controls when you enter data on a form.

1.	Make sure no controls are selected by clicking on a blank area of the form.

2.	Select the Tab Order Command on the Form Design Menu.  The cursor will change shape to indicate you are in Tab Order mode.

3.	Click the left mouse button on each control, in the order you want to establish as the tab order.  As each control is clicked, it is displayed with the selection border.

4.	Click on all controls, even if they will be display-only.  When all controls have been selected, Tab Order mode will be turned off.  To leave Tab Order mode before selecting all the controls, use the Tab Order Command.

5.	Press the Tab key to tab through the controls to check the order.  When the form is in run mode, you cannot tab to controls that are display-only controls.

Changing the Definition of a Control

To change the display attributes, title, and attached data field for a form control, either:

Click the right mouse button on the control.

Select the control, or a group of controls, then select the Edit Control Command on the form design menu.

Either action will display the appropriate control edit dialog,  If more than one control is selected, a dialog will appear for each control in turn.


Quick Form Layout

Placing a Control on a Form

Changing the Tab Order of Controls

Changing the Definition of a Control

Arranging (Moving and Sizing) Controls on a Form

Aligning Controls on a Form


Arranging Controls on a Form

To design a form, you must arrange and size the data entry controls and scroll regions.  You do this by selecting one or more controls and then using a layout tool to move or size the selected controls.

Selecting Controls

Select a control by clicking the left mouse button when the cursor is on the control.  When a control is selected, a selection border is displayed that encloses the data area of the control, its border (or underline) and its title.  This is referred to as the selection area of the control.  Clicking anywhere within this area will select the control.

To select more than one control, use one of these options:

Hold down the Shift key and click the left mouse button on each control to be selected.  With the shift key down, clicking on a control that is already selected will un-select it.

Move the mouse cursor to a blank area of the form that is not in a control's selection area.  Hold down the left mouse button and drag the mouse cursor over the form.  A selection rectangle will be drawn on the screen as you drag the mouse.  When you release the left mouse button, any control whose selection area falls within the selection rectangle will be selected.

To select a second group of controls, follow the above procedure, but hold the Shift key down before you click the left button, and while you drag the mouse cursor.

When a group of controls is selected, clicking on a selected control will not change the selection, but clicking on an un-selected control (when the Shift key is not down) will remove the selection from the group and select the new control.

To un-select all controls, click on a blank area of the form that is not in a control's selection area.

Moving Controls

To move a control, first select it.  Move the mouse cursor to fall within the control's selection area, click and hold the left mouse button, then drag the control by moving the mouse.  When the control is in the desired position, release the left mouse button.

To move a group of selected controls, click and hold the left mouse button on any of the controls, then drag them to the desired new position.  The controls will move as a group, retaining their relative positions.

You can also move controls with the arrow keys on the keyboard.  With one or more controls selected, press the arrow key for the desired direction.  Hold the key down for continuous movement.  Each keystroke moves the controls one screen unit (pixel).  For faster movement, hold the Ctrl key down.  while pressing the arrow keys.  This causes the controls to move 5 pixels for each keystroke.  When the controls are in the desired position:

Accept the new position by pressing the Enter key, or clicking the left mouse button anywhere on the form.

Cancel the move by pressing the Esc key.

Sizing Controls

A new control is placed on the form with a default size, that is determined by the maximum length of data in the field attached to the control.  Once a control placed on the form, you can change its size by dragging the appropriate border of the control's selection area.

Select the control

Move the mouse cursor to the border you want to drag.  For example, if you want to make the control wider, either drag the left border to the left, or the right border to the right.

Move to a corner of the border to change width and height at the same time.

When the cursor changes to an arrow shape, click the left mouse button and hold it while dragging the border to the desired size, then release the button.

If several controls are selected, only the control you drag will be re-sized.

Restrictions on sizing:

You can change only the width of edit controls, the height of an edit control is adjusted automatically to the font you select for controls.

When you change the size of a combo box control, you are changing the size of the drop down list for the control.  The area in which this list will be displayed is outlined in design mode so you can see where it will be.  The drop down list area is included in the control's selection area.


Aligning Controls on a Form

Aligning controls on a form consists of arranging or sizing a group of controls relative to each other.  In design mode, a set of alignment icons are displayed on the form's design mode control pad.  Clicking these icons carry out alignment and sizing operations on the selected controls.  There are corresponding commands on the Alignment menu, displayed when you select the Alignment command on the Form Design menu.

Icon	Menu Command

Align Left

Align Right

Align Top

Align Bottom

Space Equally Vertically

Space Equally Horizontally

Grow to Largest Width

Shrink to Smallest Width


Designing a Scroll Region on a Form

See Also

A scroll region is a form control that contains an embedded list.  The list can be used to display records from another view that is related in some way to the view attached to the main form.  For example, a department form could contain a scroll region with a list of employees in the department.

Designing a scroll region is similar to designing a list.  Since the list is embedded in a form, there are some additional considerations:

The scroll region has form control attributes, including a title and the position of the title.  These are defined on the Scroll Region Attributes dialog.

The List Design menu of a scroll region is displayed by clicking the right mouse key on the scroll region. It has two commands not on the standard List Design menu:

The Control Style command displays the Scroll Region Attributes dialog

The Link to Parent command displays the Edit Link dialog, which enables you to describe how the scroll region view is linked to the parent form view.  The list within the scroll region is usually linked to the parent form.

To place a scroll region on a form

1.	Select the New Scroll Region command from the Form Design menu.  The cursor will be displayed as a cross.

2.	Move the mouse cursor to the spot you want the upper left corner of the scroll region to appear, then click the left mouse button.

3.	Fill out the scroll region attributes on the Scroll Region Attributes dialog and click the OK button or press ENTER.  The scroll region will be displayed.

4.	Click and drag the border of the scroll region with the left mouse button to size the region.

Moving a scroll region

Scroll regions are sized and moved like other form controls.

Note:  The tab bar area of list in the scroll region cannot be used to select or drag the scroll region.  Mouse actions in this area are for moving and defining the column tabs of the list.

To design the scroll region

Size and position the scroll region as described above.  Clicking the right mouse button on the scroll region displays the List Design menu.

1.	Define the scroll region data view with the  Data View command on the Design menu.

2.	Define the scroll region list attributes with the List Attributes command.

3.	Define the scroll region colors and fonts with the Colors and Fonts commands

4.	Define the title (on the form) and title position of the scroll region with the Control Style command

5.	Define the way the data view of the scroll region is related to the data view of the parent form with the Link to Parent command.

Note:  The link between the list in the scroll region and the parent form is not active while the form is in design mode.


Designing Lists

Arranging Controls on a Form

Aligning Controls on a Form


Designing a Form Search Window

See Also

To include a search window on a form, check the Search Window option on the Form Attributes dialog.  When the form is in design mode, use the Search command to display the search window in design mode.

Follow the same steps in designing a search window that you would to  design a list, with the following restrictions:

You do not need to specify an ID or description for a search window since it is part of the parent form.

The data view of the search window must have the same root table as the data view of the parent form.

The button style of a search window must be OkCancel.

A search window cannot be used to add or edit records, only to find records for the parent form.

After you have specified the search window layout and control options:

1.	Select the sort option that you want to be the default option the first time the search window is displayed.

2.	Size and position the list where you want it to appear in relation to its parent form.  When you save a form design, the current size and position of the search window with respect to the parent form are saved with the design.

Size the search window by dragging its borders with the left mouse button down.

Position the search window by dragging its title bar with the left mouse button down.

To hide the search window during the design process, click the OK or Cancel button, or press the Esc key.


Designing Lists


Designing Lookup Windows

You can determine the fields that appear in the columns of a lookup window by including them in the data view of the main form.  There will be a column in the lookup window list for each field in the view that is from the linked lookup table.  The lookup window will always contain the primary key fields of the linked table, even if you don't specify them.  That way, the entries in the lookup list will always show the values that are being pasted back into the field being looked up.

For example, suppose an Employee form has the following view fields specified:

EMPID, LNAME, FNAME, HOMEDEPT (employee id, last name, first name, home department)

In the definition of the Employee table, there is a link defined that links HOMEDEPT in the Employee table to DEPTID in the Department table.  This link is called DEPTLNK in the Employee table.  Therefore the HOMEDEPT field on the form can be validated against the Department table.  If you included no fields from the Department table in the view for the Employee form, the lookup window would contain a column for one field: DEPTID.

If you wanted to also see the department name in the lookup list, you would specify it in the view of the Employee form through the link.  The ID of this field in the Department table is NAME.  It would be prefixed by the link ID in the employee form view, so the employee form view would become:

EMPID, LNAME, FNAME, HOMEDEPT, DEPTLNK.NAME

By including the field DEPTLNK.NAME in the view of the employee form, you cause the

Department table field NAME to appear as a column in the lookup window for HOMEDEPT.


Lists

The List Window

Using Lists

Displaying Lists

Entering Data with a List

List Sort Control

List Search Control

Designing Lists


The List Window

See Also	Procedures	Design Procedures

Click on an object in the above graphic to see a short description.


Using Lists

Displaying Lists

Entering Data with a List

List Sort Control

List Search Control

Designing Lists


The list title bar displays the name of the list (The name used is the description you supplied when you designed the list.).  You can click and drag the title bar to move the list on the desktop.  You can double-click the title bar to maximize the list window.  When a list is in design mode, the word "Design" precedes the name of the list.  When a list is sorting or is linked to another form or list, that is also indicated in the title bar.


The sort control of a list is a combo box that enables you to select the order that records will be displayed in the list.


The search control of a list is an edit control that enables you to search for a particular record in the list.


The search fields area on a list shows the fields that define the sort order of the records.  These fields are used to search for a record when you enter a value into the search edit control.


The Tab Bar is only visible when a list is in design mode.  It displays the column tab settings:

Click and drag a tab with the left mouse button to change the width of a column

Click on a tab with the right mouse button to display the tab alignment menu


The column heading area of a list displays the titles of the fields displayed in the list.


The main area of a list displays the list entries.  Each list entry corresponds to a record from the data view of the list.


List Command Buttons

A list can contain command buttons at the bottom of the list.  When you click on these buttons, commands are sent to the list.   There are two styles:

Button Style	Description

OK / Cancel	Selects an entry in the list, hides a pop-up list (such as a form search window).

Add / Edit / Delete	Indicates the list has an associated pop-up edit form that can be used to add, edit, or delete records in the list.


Using Lists

See Also	Procedures

A list is a desktop object that displays records from the database in a row and column format.  A row in the list corresponds to a database record.  The columns in the list correspond to fields in the record.  When you design a list, you define its data view, which determines which fields from the database are displayed in the list.  Special uses of lists include form search windows and form scroll regions.

The design of a list can include a pop-up edit form, which enables you to edit or delete a record displayed in a list, as well as add new records.

A list can also have index and search controls that enable you to change the ordering of records in a list and easily find a particular record.  The keystroke navigation feature helps you locate a record in a list.


Keystroke Navigation on Lists

In addition to scrolling up and down a list with the arrow keys or the scroll bar, or locating a record in the list with the list's search control, you can use the keystroke navigation feature of Ad Hoc to quickly locate a record in a list.  Keystroke navigation refers to using character keystrokes to move through a list whenever the list has the input focus.  Select a keystroke navigation option on the Desktop Configuration dialog.

With both types of keystroke navigation, the character keys you type are matched against the sort fields of the records displayed in the list.  See help on the list search control for details on how the matching is done.

Progressive Keystroke Navigation

Progressive keystroke navigation works much like a list search control.  When you type a character key, the character (letter or digit) is added to a search key.  If the list has a search control, the search key is displayed in the search control, otherwise you can't see it.  The highlighted entry in the list becomes the one that most closely matches the search key as you type.  If you press the backspace key, the last character in the search string is removed and the highlight moves back to the previous matching record.

To cancel a search string (for example to start another search), press the SPACE BAR.  The highlight will not move from the current record, but the next letter you type will start a new search.

Single-key Navigation

With this type of keystroke navigation, only the first character of each record is used to match keystrokes you enter.  This is the method used in a standard Windows 3.1 list box.  When you type a letter key, for example, the first entry in the list that starts with that letter is highlighted.  When you type that key again, the next entry in the list starting with that letter is highlighted.  When you reach the last matching entry, typing the letter key again takes you back to the first match.


The List Window

Keystroke Navigation

Displaying Lists

List Sort Control

List Search Control

Entering Data with a List


Displaying Lists

To open a list and display it on the desktop:

1.	Select the Open command on the File menu to display the Open dialog.

2.	Highlight the name of the list you want to open, by clicking it or using the up or down arrow to highlight it.

3.	Click the OK button, or press ENTER.

You can also just double-click on the name of the list to open it.

To put away a list

Make sure the list is the active desktop object.  Then do one of the following:

Select the Close command on the File menu.

Double-click the system menu icon in the top left corner of the list.

Click the system menu icon to display the menu, then select the Close command.

To close all the open lists and forms on the desktop, select the Close All command on the Window menu.


List Sort Control

The sort control on a list is a combo box that displays the sort options of records in the list.  Click on the sort control  to display the drop-down list of the combo box, then click on an entry to select it.  The entries in the sort order list will include:

All the indexes defined for the root table of the data view.  Each of these entries will include the index number and description.

The sort defined for the list data view, if one was defined.  This entry will show the fields in the sort specification of  the list's data view.

When you select a sort, the names of the fields that define the sort will be displayed to the right of  the search control.

If the list is a search window of a form, selecting an index as the sort order will also set the order of records in the parent form to the same index.


List Search Control

The search control on a list is an edit control that enables you enter a search value to find a particular record in the list.  When you select a sort order for the list, the fields that define the sort order are displayed to the right of the search control.  The value you enter in the search control is used to find a record with the closest match in these fields.

To find a record

1.	Determine which sort order you want to use to locate the record and select it with the sort control.

2.	Move to the search control by clicking on it, pressing Alt-S, or tabbing to it.

3.	Enter a search value that will be used to find the closest matching record.  The value you enter will be compared with value in the first sort field.

4.	Press the ENTER key (or click the OK button if the list has one).

5.	The first record from the data view that most closely matches your entry will be highlighted in the list.

How records are matched

If there is only one field that defines the sort order of a list, the search value you enter is compared with the contents of that field in each record.  The selected record is the first one in the data view whose field value is equal to or greater than the search value.  If the sort order is defined by more than one field, the first field is used.

You can enter a search value for more than one field in the sort order by separating the values with a comma.  The first value you enter is compared with the first field, the second with the second, etc.  The record selected will be the first record in the data view whose field values, taken together, are equal to or greater than the search values.

Example

A list of employee records, the sort order is Last Name, First Name.  In the employee table are the following employees:

Roberts, Peter
Smiley, Beth
Smith,  Michael
Smith,  Theresa
Sommers, John

Entering Search Value	Will find the record for

S	Beth Smiley

Smith	Michael Smith

Smith,T	Theresa Smith

Smi,Theresa	Beth Smiley (because Smiley is the first record greater than or equal to Smi)


Entering Data with a List

A list can be used to enter and edit records in the database if it has been designed with a pop-up edit form.  A list with an edit form has Add, Edit, and Delete command buttons displayed at the bottom of the list.  The list edit form is displayed if you click the Add or Edit buttons.

Entering data on a pop-up edit form is similar to using a standard form for entering data (see Entering Data on a Form).  The differences are:

The pop-up edit form of a list can display only the record that is highlighted in the list (or a new record that will be inserted in the list).

The pop-up form's control pad contains only the update and cancel icons.

To edit (make changes to) a record

1.	Highlight the record in the list.

2.	Click the Edit button, or press Alt-E.

3.	Make the changes on the pop-up edit form, then select the Update Record command.

To cancel the edit, use the Cancel Record Changes command.

To add a new record

1.	Click the Add button, or press Alt-A.

2.	Fill out the pop-up edit form, then select the Update Record command.

To cancel the add, use the Cancel Record Changes command.

When you add a new record, the list is re displayed so that the new record is displayed and highlighted in the list.

Note:  You can add new records on a list only if the Add permission was specified in the list design and the edit form contains all the required fields in the root table of the list's data view.

To delete a record

1.	Make sure the correct record is highlighted in the list.

2.	Click the Delete button, or press Alt-D.

3.	Ad Hoc will ask you to confirm the deletion.

You can delete records in a list only if the Delete permission was specified in the list design.


Designing Lists

See Also	Procedures

Lists have a number of uses in Ad Hoc.  The basic steps in designing a list are the same for all uses, but there are some differences.  This help topic describes the design process for a standalone list, see the topics noted below for specifics on the other uses of a list.

Use	Design Process

Standalone desktop object	Use the New command on the File menu to open a new list and the Save command to save it in the Forms table.

Search window of a form	Designed as part of the form.  See Designing a Form Search Window.

Embedded in a Scroll Region	Designed as part of the form.  See Designing a Scroll Region on a Form.

Steps in designing a list

Use the File New command on the File menu to open a new list on the desktop, or use the File Open command to open an existing list.  A new list is opened in design mode.  To put an existing list in design mode, select the Design Mode command on the List menu.  Display the List menu by clicking the right mouse button on the list, or by pressing Alt-M.  To design a new list:

1.	Decide how you want to use the list, and what data will appear on it.

2.	Define the data view attached to the list by selecting the Data View command on the List Design menu to display the Edit View dialog.  See Defining Data views.

3.	Define the fields to appear on the list, the column titles, list controls, and database permissions by selecting the List Attributes Command to display the List Attributes dialog.  See Designing a List Layout.

4.	Position the columns of the list (See Setting List Columns).

5.	Select the list colors by using the Colors Command to display the Colors dialog and the list fonts by using the Fonts Command to display the Fonts dialog.

6.	If you have specified the AddEditDelete button style on the List Attributes Dialog, the list will have a pop-up edit form.  Design the Edit Form (see Designing a List Edit Form).

7.	Size the list by dragging its borders with the left mouse button.  The size of the list when it is saved will be its initial size when it is opened on the desktop.

8.	Move the list to the position where you want it to appear on the desktop when it is first opened.  Move the list by dragging its title bar with the left mouse button.

9.	Leave design mode by selecting the Leave Design Mode command on the List Design menu.

10.	Select the Run Diagnostics command on either the List Run menu or the List Design menu, to check the design of the list.  (See Diagnostics).

11.	Save the list design with the Save command on the File menu.

To make modifications to a list design

1.	Display the list on the desktop

2.	Select the Design Mode command from the List menu

3.	Make the desired changes

4.	Leave design mode by selecting the Leave Design Mode command on the List Design menu

5.	Save the list design with the Save command on the File menu

To delete a list design from the database

Select the Delete command on the File menu

Select the list design you want to delete from the list of forms and other desktop objects

Click OK or press ENTER.  Ad Hoc will ask you to confirm the deletion.


Defining Data Views

Designing a List Layout

Setting List Columns

Designing a List Edit Form


Designing a List Layout

The elements of a list layout include

The controls that appear on the list

The fields that are displayed in the columns of the list

The spacing and alignment of the columns

The fonts and colors of the list

List Controls

The controls that appear on a list are defined on the List Attributes dialog.

Check the  Search Control option if you want to be able to find records in the list by typing in a search value.

Check the Sort Control option if you want to be able to change the record sort order while using a list.

Select one of the following button styles

Button Style	Description

None	The list will have no command buttons.

OKCancel	Used for search windows.  The list will have two buttons:
OK hides the list and sends a selection notification to its parent form
Cancel hides the list.

AddEditDelete	Indicates the list has an associated pop-up edit form that can be used to add, edit, or delete records in the list.  The list will have three buttons:
Add displays the edit form for adding a new record
Edit displays the edit form for editing the current selection in the list
Delete deletes the current selection in the list

List Fields

Select the fields to display in the columns of the list from the fields defined in the data view.  Fields to be displayed are selected on the List Attributes dialog.

Each displayed field defines a column in the list display.  If you have selected the Column Headings option on the List Attributes dialog, you can designate a title for each column.  The fields you display will depend upon your application, but you should include fields that will help the user identify the records in the list.  (For example, for a list of employees, you should include the employee ID and name).  Include fields that help the user identify the sort order for each sort option available in the list.  (For example, if you can order the employee records by employee ID, the ID field should be included as a column in the list.)

Spacing and Alignment of List Columns

Once you have designated the fields that will be displayed on the list, you can size the columns using the tab bar displayed at the top of the list in design mode (see Setting List Columns).

Fonts and Colors

Use the Font command on the List Design menu to designate the fonts in the list.

Use the Colors command on the List Design menu to designate the list colors.


Setting List Columns

A list displays records in a row and column format.  Each row is a record, and each column corresponds to a field in the record.  When a form is in design mode, a tab bar is displayed above the column heading area of the list.  The tab bar contains a tab for each column in the list.

Tabs can only be moved right or left;  they cannot be deleted.

To move a column

1.	Click and hold the left mouse button when the cursor is over the tab for the column.

2.	Drag the tab to the left or right, release the mouse button at the desired location.

To move a column and all columns to the right

Depress and hold the Shift key, then click and drag the tab to the desired position.  All tabs to the right of the dragged tab will maintain their relative positions to this tab.

To change the width of a column

Move the tabs located to the right of the column.

To add a column

Insert a new field in the Displayed Fields list on the List Attributes dialog.  Insert the field in the correct position in the Displayed Fields list.  The list determines the order of the columns from left to right.

To remove a column

Delete the corresponding field from the Displayed Fields list on the List Attributes Dialog.

To change the alignment of a column

Click the right mouse button on the tab for the column to display the column alignment menu.  Select the desired menu option.

Alignment Type	Description

Left	The column is left aligned at the tab position

Right	The column is right aligned at the tab position

Centered	The column is centered around the tab position

Decimal	The contents of the column are positioned so that the first decimal point (period) is aligned with the tab position.  If there is no decimal point, this option acts like right alignment.  Use this alignment only for numeric fields that contain a decimal point.


Designing a List Edit Form

If you want to edit database records displayed in a list, you must include a pop-up edit form in the design.  With the form in design mode:

1.	Select the AddEditDelete button style on the List Attributes dialog.

2.	Set the database access permissions allowed for the list (see List Attributes dialog).

3.	Click on the Add or Edit list command button (or press Alt-A or Alt-E) to display the edit form.

4.	Size the edit form by dragging its borders with the left mouse button

5.	Position the edit form by dragging its title bar with the left mouse button.  Position the form where you want it to pop-up relative to its parent.

6.	Design the layout of the form just as you would design a standard desktop form (see Designing Forms).  Clicking the right mouse button on the list edit form displays the Form Design menu.

7.	An ID is not needed for a pop-up form, and a description is optional.  If you supply a description, it is displayed in the title bar of the form, preceded by "Edit" in Edit mode and "New" in Add mode.

8.	Make sure the form is the correct size.

9.	Hide the pop-up edit form with the Cancel command or the Hide Pop-up Form command on the Form Design menu (this command replaces the Leave Design Mode command for pop-up edit forms).

Design Restrictions:

The edit form uses the data view of the parent list, so all fields that will appear on the edit form must be defined in the list data view.

Database add, edit, and delete permissions for the list apply to the edit form.  They are defined on the List Attributes dialog.

A list edit form cannot have a data exchange template.

You cannot leave design mode from the edit form.  You must hide it and use the Leave Design mode command on the List Design menu.

Edit Forms for Embedded Lists

If a list embedded in a scroll region of a form is linked to the parent form (the usual situation), you do not have to put the fields that define the link on the pop-up edit form.  They are automatically set to the values determined by the current record on the parent form.  Using an example from the Ad Hoc sample database, on the Employees form there is an embedded list called Personnel Actions.  This list is linked to the Employees form by the employee ID.  The pop-up edit form for this list doesn't have a control for Employee ID because the ID is automatically set to the ID of the record currently displayed on the Employee form when a new personnel action is added to the list.


Keyboard Reference

Global Keys for Ad Hoc

F1	Display context sensitive Help

Shift+F1	Display help system table of contents

Ctrl+F1	Search for help on a topic

F2	Open a desktop object

Shift+F2	Open a new desktop object to design

F3	Close the active desktop object

F4	Save the design of the active desktop object

F9	Print a report

Shift+F9	Open a report design window

Ctrl+F9	Display a report on the screen

F10	Display/Hide Tables Window

Forms

Ctrl+D	Delete the current record

Ctrl+F	Display the first record in the data view

Ctrl+L	Display the last record in the data view

Alt+M	Display the Form Menu (or the Form Design Menu if in design mode)

Ctrl+N	Display the next record

Ctrl+P	Display the previous record

Ctrl+S	Display the search window to find a record

Enter	Accept changes on the form, update the database

Esc	Discard changes on the form, restore the original contents

Ins	Start editing a new record

Tab	Move from one control to another on the form

Shift+Tab	Move backwards from one control to another

F6	Cycle between the form and its scroll regions (if any)

Lists

Alt+A	Display the edit form to add a new record

Alt+D	Delete the selected record in the list

Alt+E	Display the edit form to edit the selected record in the list

Alt+M	Display the List Menu (or the List Design Menu if in design mode)

Alt+O	Move to the sort order selection control

Alt+S	Move to the search control

Enter	Accept the selected record and close (for search windows)
Accept the search value and find a record (for search windows when the search control has the focus)

Esc	Close with no selection (for search windows)

Report Design Windows

Ins	Insert a field at the cursor position

Shift+Ins	Insert a new element below (after) the current element

Alt+M	Display the Report Design Window pop-up menu

Report Display Windows

Ctrl+F	Display the first page

Ctrl+G	Go to Page...

Ctrl+L	Display the last page

Ctrl+N	Display the next page

Ctrl+P	Display the previous page


Reports

Understanding Reports

Printing Reports

Displaying Reports on the Screen

Printer Setup

Report Design Window

Report Display Window

Designing Reports


Understanding Reports

Ad Hoc uses a unique model for a report that gives you a great deal of flexibility in designing complex reports.

Report Identifiers

When you design a report, you must specify a report ID, which is unique to that report, and a longer report description.  The ID is the primary key of the report in the Reports table, the description is displayed in report selection lists.

Report Data View

You specify the information from the database that appears on the report by defining a data view for the report.  As with any data view, you can specify the sort specification and filter.    The fields from the view can be inserted anywhere in the report design.  When Ad Hoc prints a report, it opens the report view and reads records from the view.  As each record is read, it triggers an event. Events result in an action such as the printing of a line of the report, or a computation of a report field value.  See Report Events for a list of the events.

Report Layout

A report design specifies how information is presented on a printed page.  The Report Layout dialog enables you to specify the physical dimensions of the page, and the page margins.  You can also specify whether the report is printed in landscape or portrait orientation.  The page size, orientation, and margins determine the area in which the report can be printed.

You must define one or more regions within the report area.  A region specifies an area within which specified information is printed.  A simple report layout may have two regions: a page header region within which the title and column headings are printed, and a detail region, within which the detail lines of the report are printed.

A report element defines the information that is printed in a report.  An element can contain text, database fields, and report fields.  When you design a report, you specify the contents of each element, its tab settings, and its font.  An element is printed in response to an event and is printed in a specified region.  In the simple report mentioned above, there would be two elements, one for the title and column headings, and one for the report detail line (one detail line is printed for each record read from the view).  When a page header event occurs, the title/column heading element is printed in the page header region.  When a detail line event occurs, a detail line is printed in the detail region.  As each record is read, a detail line is printed until the detail region is full.  This triggers a page header event, and a new page is started.

Regions can be sized by the size of their contents, so that only one instance of each element in the region can fit.  A page header region would fall into this category.  Regions can also be larger than the elements assigned to the region, in which case the elements are repeated in the region until it is full.

Fonts and Tab Settings

You can specify a font for each report element.  You can specify a default font for the report, and indicate that an element is to use the report font.  If several elements are using the report font, you can change their fonts by making only the one change to the report font.

Similarly, each element has its own tab settings.  You can specify several elements use a common set of tabs, so that changing the tabs for any of these elements changes them for all elements using the common tabs.

If you need to use different fonts or tab settings within a section of the report, you must break that section up into different elements for each font or tab setting.

Computed Fields

In addition to the database fields defined in the view, you can define additional fields for the report.  The definition of these fields includes an expression that is used to compute the field value, and an event that triggers the computation of the value.  Computed fields can be placed on the startup dialog, so that the user can enter a value before the report prints.  Computed fields can be included in a report layout, or can be used in the filter of the data view, allowing the user to specify record selection criteria for the report.  See Field Expressions for more information on expressions.

Total Fields

Total fields are a special kind of computed field that are computed from the values of database fields as records are read.  They can hold a count of records, a running total of a specified numeric field in the data view, a running average of a specified field, and other types of computations.  See Edit Total Field Dialog for a detailed description.


Report Events

Event	When it happens

Report Header	At the beginning of the report, after the computed fields are computed and the startup dialog is displayed.

Page Header	Each time a new page is started, including the first page.

Detail Line	Each time a record is read from the view.

Page Footer	The last event for a page, just before a new page is started.

Report Footer	At the end of the report, before the last page is completed (before the page footer of the last page)

Break Header	After a record is read, but before the detail line event, if the record causes a report break.  A break header event is generated for each break level that has occurred.

Break Footer	After a record is read, and after the detail line event, if the next record to be read will cause a report break.  A break footer event is generated for each break level that will occur.

Break header and footer events are issued in the order of the break levels. Higher level break headers are issued before lower levels, and lower level break footers are issued before higher levels.  When a break event is issued, all lower level break events are automatically issued.

Example

Assume an employee report sorted by department and group within department.  The report includes a heading for department that is printed each time the department changes, and a total line showing the number of employees in the department.  There is a similar header line and total line for group.  You would define break levels for department and group.

As the report is printed, if the next record to be read is an employee from a different department than the current record, the break events will occur in the following sequence (includes the detail line event of the current record):

Event	Triggers this element

detail line	report detail line for current record

group break footer	total line for group

dept break footer	total line for department

dept break header	heading for the next department

group break header	heading for the next group

detail line	report detail line for next record


Printing Reports

Report designs are stored in the Reports table of the database.  To print a report:

1.	Make sure your printer is connected, turned on, and on-line.

2.	If the report requires a special printer configuration, such as page orientation or paper source, use the Printer Setup command on the File menu to select and configure a printer.

3.	Select the Print Report command on the File menu to display the Print Report dialog.

4.	The Print Report dialog contains a list of all reports stored in the database, sorted alphabetically by description.

5.	Highlight the report you want to print, then click the OK button or press the Enter key.

6.	Shortcut: Select a report and print it by double-clicking on the entry in the list.

7.	If the report has a startup dialog, enter the information requested on the dialog, then press Enter or click the OK button.

8.	If the report has to sort records in its data view, it will display a sorting progress box showing the number of records read and the total number to sort.

9.	While the report is printing, the Print Report dialog is displayed.  This dialog shows the report being printed, the printer being used, and the page of the report that is currently printing.

10.	To cancel the report before it completes printing, click the Cancel button on the Print Report dialog.


Printer Setup

Use the Printer Setup command on the File menu to select a printer attached to your computer, and set the configuration of the printer.  When you select a printer and configure it using the Printer Setup command, the settings are used only by Ad Hoc; the printer configuration you designate within Ad Hoc is not seen by other programs.

The configuration settings that are most commonly changed are:

Page Orientation

A report can be printed in landscape orientation or portrait orientation.  A report design can designate the orientation to be used for the report, or can specify that the current printer setting be used.  In the latter case, you can set the orientation of a report with the Printer Setup command.

Paper Source

Most printers offer at least two paper sources: automatic feed and manual feed.  Some offer more than one paper bin, or have an envelope feeder.  The report design in Ad Hoc does not contain a designation of paper source,  so you must set the paper source using the Printer Setup command before you print a report that requires a special setting.


Displaying Reports on the Screen

See Also

To display a report on the screen, select the Display Report command on the File menu, or select the Display command on the Report menu when a report design window is active.

Reports are displayed with the same layout, fonts, tabs, etc. as when they are printed.  The report display window is useful to preview a report as you are designing it.


Report Display Window


Report Display Window

See Also

You use a report display window to view a report on the screen instead of printing it.  To open a report display window, select the Display Report command on the File menu.  If you are designing a report in a report design window, you can display the output of the report in a report display window by selecting the Display command on the Report menu.  You may have any number of report display windows open at the same time, using the File menu Display Report command.  From a report design window you can open only one associated report display window.

A report display window will display a report exactly as it would be printed.  You can, however, change the scaling (magnification) of the report to see more of it in the window.  You can also set an option to change the page height in the report layout to equal the height of the report display window, so that you can see an entire page of the report (shorter than it would be on paper), at whatever magnification you select.

When you select a report to be displayed, the report display window will load the report from the database, and begin generating the report output.  As each page is generated, it is stored in memory.  You can select an option to store the pages temporarily on disk if the memory in your computer is limited.  As soon as the first page is completed, it is displayed in the window.  You may move to any page that has been generated while the report is being processed.  After the report processing is complete, you can view any page of the report until you start another report or until you close the report display window.

You can change the scaling (magnification) of the report to from 10 percent to 200 percent of actual size (as it would appear on the printed page).  Since "actual size" on a display screen appears somewhat larger than printer output (depending on your display resolution and monitor size) you may find that a scaling of around 75 to 80 percent is most readable.

Since a report for an 8 1/2 x 11 inch sheet of paper, for example, will not fit entirely within a window, and scaling it to fit would probably result in a font size that is too small to read, you have an additional option of shortening the page height in the report design to match the height of the report display window.  When you change this option, you must restart the report.  Page heights are fixed after a report is generated, although you can change the magnification at any time.

Report Display Window Menu

The report display window menu is a pop-up menu that you can activate by clicking the right mouse button whenever the cursor is over the display area of the window.  This menu contains commands that allow you to select reports, restart the current report, select pages for display, and set the view options for the window.  See Report Display Window menu.

Display Options

Display options can be set using the Options command on the Report Display Window menu.  This command displays the Report Display Window Options dialog.

Title Bar

The title bar of the report display window contains the long description of the report that you entered when you designed the report.  It also contains the page number of the page currently being displayed, as well as the total pages of the report.  As a report is being generated, you will see the pages total increase.  The designation "processing" will also be in the title bar while the report is being generated.


Displaying Reports on the Screen

Report Display Window Control Pad

Report Display Window Menu

Report Display Window Options


Report Display Window Control Pad

The report display window contains a control pad that enables you to select pages to display, or stop the report while it is being generated.  The controls on this control pad are:

First Page

Click this icon to display the first page of the report.

Previous Page

Click this icon to display the previous page.

Next Page

Click this icon to display the next page.

Last Page

Click this icon to display the last page of the report.  If the report is still being generated, the last generated page will be displayed.

Stop Report

This icon is displayed while the report is being generated, and is grayed out when the report generation is complete.  Click this icon to stop the generation of the report.  You can still view the pages that were already generated.


The title bar of the report display window displays the name (description) of the report, the page currently being displayed, and the total number of pages in the report.


The display area of the report display window is where the report appears.  You can display the report at varying magnitudes.  Click the right mouse button in this area on the report display window to pop up the Report Display Window Options dialog.


Designing Reports

See Also	Procedures

Before you design a report, you should read the topic Understanding Reports which describes the structure and characteristics of an Ad Hoc report design.

The steps in designing a report

1.	Open a new report design window by selecting the New command on the File menu, then selecting one of the Report options.  Fill out the initial design dialogs that are automatically displayed for a new report.

To work with the design of an existing report, already saved in the database, use the Design Report command to open a window for the report design.

2.	When a report design window is active, the Report menu appears on the Ad Hoc menu bar.  This menu contains the report edit commands.  There are also pop-up menus that you can display by clicking the right mouse button on areas of the report design window.  If you click on the area of a report element, you will display the element design menu.  If you click on a tab on the ruler, you get the tab menu.  If you click on any other area of the report design window, you get a pop-up report design menu.

3.	Define the report layout and attributes with the Layout command, which displays the Report Layout dialog (or the Label Report Layout dialog if the report is a label-style report).

4.	Define any computed fields you want for the report with the Computed Fields command.  Computed fields are defined using the Edit Computed Field dialog.

5.	Define the report data view with the Data View command, which displays the Edit View dialog.

6.	Define the report break levels, if any, with the Report Breaks command, which displays the Report Breaks dialog.

7.	Define any total fields you want for the report with the Total Fields command.  Total fields are defined on the Edit Total Field dialog.

8.	Define the regions the report will have, using the Regions command.  Regions are defined on the Edit Report Region dialog.  See Designing Report Regions for details.

9.	Define the elements of the report, using the Elements command.  Elements are defined on the Edit Element dialog.  See  Designing Report Elements for details.

10.	Set the tabs for each report element.

11.	Type in the contents of each report element.

12.	Design the report startup dialog, if the report has one.  See Designing a Report Startup Dialog.

13.	Select the Run Diagnostics command on the Report menu to check your design.  (See Diagnostics.)

14.	Select the Display command to test the report design by displaying the report on the screen.  (See Report Display Window)

15.	Use the Save command on the File menu to save the report design in the database.

Quick Report Setup

When you start a new report, Ad Hoc can help you set up a report if you select Quick Report Setup.  Ad Hoc will first display the Report Layout dialog and the Edit View dialog for you to establish the basics of the report.  It will then display the Quick Report Setup dialog which enables you to enter the report title, fonts for the main parts of the report, and other design options.  Ad Hoc will then set up the basic design for a standard report with a title, column headings, a detail line, and a page footer with optional date and page number.  You must enter the fields and text in the column heading and detail line.


Report Design "How To's

Understanding Reports

Report Design Window

Creating a Report Quickly

Report Events

Designing Report Regions

Designing Report Elements

Setting Report Tabs

Designing Report Breaks

Specifying Page Breaks

Designing a Report Startup Dialog


Report Design Windows
Report Design Window

See Also	Procedures

A report design window is a desktop object that displays a report design (template).  You use a report design window to create a new report or change the design of an existing report.

Click on areas of the above graphic to see a short description.

Ruler

The ruler displays the tab settings for the active element (the element that contains the edit cursor) and is used to change tab settings.  See Setting Report Tabs.

Element Edit Area

A report design window contains an element edit area for each element of the report.  The elements are displayed in the order that they are defined on the Report Elements dialog.  When you move the edit cursor into an element edit area, the tab settings for the element are displayed on the ruler, and the description of the element and its region are displayed on the Ad Hoc status bar.  The size of the edit area for an element is determined by the size you specify for the element on the Edit Element dialog.


The title bar of a report window displays the long description of the report being designed.  If a description has not been entered, it displays "untitled".


Element Edit Areas display the design of each element in the report.  The top two areas are the elements for the report title and column headings.  Click the right mouse button in an edit element area to display the element edit fastmenu.


Element Edit Areas display the design of each element in the report.  The third and fourth areas contain the layout for two detail line elements.  Fields inserted in the text of an element are displayed in the element edit area as the field ID enclosed in braces { }.


Element Edit Areas display the design of each element in the report.  The bottom area contains a page footer element with two built-in fields for report date and page number.


left report margin indicator


right report margin indicator


element left margin indicator.  Marks the left margin of the active element edit area.


element right margin indicator.  Marks the right margin of the active element edit area.


tab indicator.  Drag tabs with the left mouse button to change their position.  Drag a tab off the tab bar to remove it.  Click the right mouse button on a tab to display the tab fastmenu, which enables you to change the alignment of the tab: left, right, center, decimal.


the tab bar of the ruler, which displays tab settings, and margins for the currently active element edit area.


the ruler scale displays horizontal measurements in inches.  Click the right mouse button in this area to display the report design window fastmenu, which contains a frequently used subset of commands from the Report menu.


Click the right mouse button in this area to display the report design window fastmenu, which contains a frequently used subset of commands from the Report menu.


Understanding Reports

Designing Reports Overview

Creating a Report Quickly

Report Events

Designing Report Regions

Designing Report Elements

Setting Report Tabs

Designing Report Breaks

Specifying Page Breaks

Designing a Report Startup Dialog


Creating a Report Quickly

See Also

You can create a standard row and column report quickly by using Quick Report Setup feature of Ad Hoc.  This features generates a standard report with a title, column headings, a detail line with the fields you select, and an optional page footer with date and/or page number.  Once the report design is generated, you can use any of the report design tools to modify the report design.

Select the New command on the File menu, then select the Report (Quick Setup) option.  A series of dialogs will be displayed.

On the Report Layout dialog, enter an ID for the report, and a Description.  The description is displayed in report selection lists to help identify the report, but the Quick Report designer also uses it as the report title, which you can change.

Set the other layout options on the Layout dialog, or leave them at their default settings.  One that you may want to change at this time is the default report font.  Click the Font button to display the font dialog.

On the Edit View dialog, designate the table from which the report will be printed, and the fields used on the report.  You can also specify a sort specification and a filter.  On this dialog, designate the database fields that not only will appear on the report, but will also be used to sort and filter the report.

On the Quick Report Setup dialog, enter the report title, specify the fonts for the title, column headings, detail line, and footer.  Check the options for date and page number if you want them to appear in the report footer.

On the Report Columns dialog, select the fields from the data view that will correspond to the columns of the report.  The order that you specify here is the order of the report columns, from left to right.

After the Report Columns dialog, the report layout is displayed in the report design window.

Make any additional changes using the standard design tools and dialogs.  The Quick Report Setup and Report Column dialogs are one-time only, and are not displayed again.

Save the report design with the Save command on the File menu.


Designing Reports: How To...

Designing Reports Overview

Understanding Reports

Report Design Window

Report Events

Designing Report Regions

Designing Report Elements

Setting Report Tabs

Designing Report Breaks

Specifying Page Breaks

Designing a Report Startup Dialog


Label Reports

See Also

The Ad Hoc label report setup feature helps you quickly create a report for printing mailing labels, or similar layouts.

Select the New command on the File menu, then select the Report (Quick Setup) option.  A series of dialogs will be displayed.

On the Label Report Layout dialog, specify an ID and description.

If you are printing standard labels, select label style from the Style list.  If the style you want isn't in the list, select Custom and define the layout yourself.  See Label Layout Measurements

Specify the font and margins for the label, they are not set for the standard styles.

On the Edit View dialog, specify the table from which the labels will be printed, and the fields to appear on the label (or that will be used to sort and filter the records).  Specify the sort specification and filter.

Insert the fields to appear on the labels into the element edit area for the label

If an element edit area doesn't appear on the report design window, check the dimensions of the label that you specified. Use the Report Layout command on the Report menu to display the Layout dialog.

Labels for laser printers

Select the Sheet option on the Label Report Layout menu.

Labels for laser printers come on sheets, usually 8½ x 11, and when you specify the layout, you can specify the number of labels across and down that actually appear on the label sheet.

Labels for dot matrix printers

Select the Continuous option on the Label Report Layout menu.

 Labels for dot matrix printers come in a continuous pin-feed format.  For continuous labels, you don't specify the page height, number of labels down, or a top margin.  Ad Hoc sets the top margin (for the report) to zero so that you can line your printer up with the top of the first label.  You can still set a top margin for each label.  Ad Hoc computes a page height and number of labels down from the vertical label spacing you provide.  These are used internally for printer control.


Printing Envelopes


Label Layout Measurements


Designing Report Regions

Use the Regions command on the Report menu to add, change, or delete the regions of the report.  This command displays the Report Regions dialog, which contains a list of the regions defined for the report.   See Edit Report Region dialog for details on the design options for a region.

When you need to specify a region

A report must have at least one region in which information will be printed.

If the report contains a page footer, it must have a separate region for the footer to reserve space at the bottom of the page.

Whenever you want an area of the report to have a border style (such as an line under the page header) define a region for that area.

Order of regions in the Report Regions dialog

The order that you add regions in the Report Regions dialog is important in only one case:  If a region is a floating region, it must be placed in the list between the regions that are located above and below it on the report layout.

Fixed and floating regions

A fixed region is one that has a specific location and size on the report layout.  A floating region is one that extends between the region above it and the region below it on the report layout.  It's top is determined by the region above it and its bottom is determined by the region below it.  You cannot place two floating regions together.

Fixed regions have a specific location on the page relative to the report margins, and have fixed size that is either a specified measurement or is determined by the sizes of the elements assigned to the region.  Floating regions will have fixed width (regions cannot float horizontally).

Elements can repeat in a region only if it has a specified size that is large enough to hold multiple repetitions of an element or if it is a floating region that is large enough.

Use fixed regions for page headers and footers

Use a floating region for the main area where the report details lines will print.  It floats between the header and the footer regions.


Designing Report Elements

Use the Elements command on the Report menu to add, change, and delete elements from the report design.  This command displays the Report Elements dialog, which contains a list of the regions defined for the report.

See Edit Element dialog for help on the detailed design options for elements.  Use this dialog to define

The element description

The region the element will be printed in

The event that will cause the element to be printed

The size and margins of the element

The font and line spacing

If a page break occurs before or after the element is printed

If blank lines in the element are printed or skipped

Define a report element for each piece of information (text and fields) that:

Is printed in a different region of the report

Is printed in response to a different event

Requires its own font or tab settings

Order of elements in the Report Elements dialog

Elements are displayed on the report design window in the order they are defined on the Report Elements dialog.  The order they appear in the list is also the order that elements assigned to the same region and triggered by the same event will be printed.  For example, if you have defined an element for the report title and an element for the column headings, they both will appear in the page header region and be triggered by the page header event, so make sure the report title element comes before the column heading element in the elements list if you want the report title to be printed first.

Element size and margins

For most reports, an element is a line (or lines) of text that extends between the left and right borders of the region.  In these cases, you don't specify a fixed size for the element.  Its width is determined by the region width (usually the report page margins) and its height is determined by the height of the text (or line spacing if that is specified) times the number of lines.

Sometimes you want an element to be a fixed size.  An example is when you are designing a label report.  Specify a fixed size for an element when:

You want the elements to repeat horizontally (left to right) within a region

You want to keep the contents of the element from printing outside the element boundary

Element margins have different purposes for fixed size and non-fixed size elements:

Margins for	Fixed Size Elements	Non-Fixed Size Elements
Left and Right	determine margin within the fixed boundary of the element.	indent the element from the left and right boundary of the region
Top and Bottom	determine a margin within the fixed boundary of the element	determine the vertical spacing between repeating elements in the region
The contents of fixed-size elements are clipped (i.e. not printed) outsize the margins.  The contents of non-fixed size elements are clipped outside the left and right margins (unless you specify word wrapping) but are not affected by the top and bottom margins.

Editing the contents of an element

To edit the contents of an element, click on the element edit area in the report design window, or use the cursor keys to move the edit cursor into the element edit area.

Type in text that will appear in the element.

To insert a field value in the text, position the edit cursor at the insertion point and press the Ins key.  The Report Fields dialog will be displayed, enabling you to select a field to be inserted.

Press the backspace key to delete text and fields to the left of the edit cursor.

Press the Del key to delete text and fields to the right of the edit cursor.

To select a section of text, click and hold the left mouse button and drag it though the text to highlight a selection.  When a selection is highlighted, it is deleted by press backspace or Del.

Placing text and fields horizontally

Use tabs to locate text and fields horizontally within an element.  Do not use spaces to position text in a element, particularly if you are using a variable pitch font.

See Setting Report Tabs for help on defining the tab settings for an element

To insert a tab in the text of an element, press the Tab key

If you have defined a fixed size for the element on the Edit Element dialog, then you can also specify a left margin for the element.

Indenting Elements

Use the left and right margin settings for an element to indent the contents of the element.  If an element is not a fixed size, the indent will be from the left or right border of the region.  If an element is a fixed size, the indent will be from the left or right edge of the element.

Vertical Spacing of Elements

You can control the vertical spacing between elements within a region by specifying a top or bottom margin for the element.  For non-fixed size elements, the top and bottom margins are used to add space above or below the element.  They are in effect, added outside the boundary of the element.  For fixed size elements, the top or bottom margin is measured within the specified vertical height of the element, and affect the height available for the contents of the element.

Spacing Lines of Text in an Element

You can control the vertical placement of text in an element with the Line Spacing option on the Edit Element dialog.  If you select the automatic option, the line spacing will be determined by the size of the font, otherwise you can specify the line spacing in points.


Setting Report Tabs

Use the ruler displayed at the top of the report design window to set tab stops for an element.  Each element has its own tab settings, and when you move the edit cursor into an element's edit box, the element's tabs settings are displayed on the ruler.

To add a tab stop

Click the left mouse button at the spot in the ruler tab area where you want to place the tab

To move a tab stop

Position the mouse cursor over the tab icon, and use the left mouse button to drag the tab to the right or left, then release the mouse button.  When the button is down, a tab position window is displayed next to the cursor, showing the tab position to the nearest .001 inch.

To remove a tab stop

Position the mouse cursor over the tab icon, click and hold the left mouse button while moving the mouse cursor out of the ruler tab area, then release the mouse button.

To change the alignment of a tab

Click the right mouse button on the tab icon to display the Tab Style menu, select one of the following tab styles:

Alignment	Tab	Description

Left Tab	Text typed after the tab will be positioned at the tab position (left aligned on the tab)

Right Tab	Text typed after the tab will be positioned before the tab (right aligned on the tab)

Centered Tab	Text typed after the tab will be centered around the tab

Decimal Tab	Text typed after the tab will be right aligned until a decimal point (period) is typed,  the decimal point will be aligned with the tab position.  Use decimal tabs only for positioning numerical data that contains decimal points


Designing Report Breaks

See Also

As records are retrieved from the database for a report, a report break happens when the value of one or more fields in a record is different from the value in the previous record.  Report breaks are used to group related records in a report, so that you can:

print a break header line before each group of records

print a break footer line, which could contain subtotals, at the end of each group of records

start a new page for each group of records

Report breaks are associated with the sort order that you have specified for the report on the Edit View dialog.  Any of the fields in the sort specification can be used to define a break.  You can have multiple levels of breaks, or groups of records within groups.

For example, suppose a company has several divisions, and there are several departments within each division.  Employee records contain the division the employee works in (the DIV field) and the department the employee works in (the DEPT field).  If an employee report is sorted by division, and department within division, the sort fields are DIV, DEPT.

You can define a break when DIV changes, and another break when DEPT changes.  The DIV break is a higher break level than the DEPT break, because the sort order nest the record groups determined by the department within the larger groups determined by division.

When a break occurs, a break event is generated, and any elements triggered by that event are printed.  Two events are actually generated when a break occurs:

a break footer event is generated first, so that you can use it to print a footer (or total) line for the previous group of records

a break header event is generated next.  Use to print headings for the next group of records.

A higher level break generates break events for all lower level breaks;  The order of breaks is illustrated below:


Report Breaks Dialog


Specifying Page Breaks

A page break is when a new page is started for a report.  Automatic page breaks occur when a region "fills up" and its time to print the next element for that region.

You can force a page break by setting a page break option for an element.  A frequent use of this option is when you want to start a new page when a report break happens (i.e., at the start of a new group of records), or a new page for each record.  To set a page break for an event, you must have an element that is triggered by that event.  You can specify that the next page is begun before or after the element is printed.

Specify the page break option for an element on the Edit Element dialog.

To start a new page, then print the element, set the page break on option to Before.  If several elements are printed at the same event, set the page break option for only the first element in the group.

To print the element, then start a new page, set the option to After.  If several elements are printed at the same event, set the page break option for only the last element in the group.

If you want the page numbering to start over again at 1 after the break happens, check the Set page to 1 option.

If you don't want an element to cause a break, but want it to be printed when a break occurs, check the Render on Break option.  This is not necessary for elements triggered by a page header or page footer event, since they are automatically rendered at a page break.

This option is useful if the report contains group headings and you want the group heading be printed on each new page, even though it didn't change from the last page.


Designing a Report Startup Dialog

A report startup dialog allows you to set the value of computed fields in the report at the time the report is printed.  The primary use for fields set with a startup dialog are to enter values into these fields that you want to appear somewhere on the report (e.g. you can set the title just before you print the report, or enter comments that will appear on the report), or to enter values that will be used in filter rules to select specific records that will appear in the report.  For this latter use, you must define a computed field and use it as a comparison value against a database field in the filter for the view.  (See Edit View dialog.)

To include a startup dialog with the report design, check the Startup Dialog option on the Report Layout dialog.  When this option is checked,  you can select the Edit Startup Dialog command on the Report menu to display the report dialog.

You design a report dialog the same way you design a form, although the report dialog does not contain all of the layout tools of a form.  See Designing Forms for detailed help.  Click the right mouse button when the mouse cursor is over the report startup dialog to display the Report Dialog Design menu.  The commands on this menu function identically to the commands on the Form Design menu.  The controls on a report dialog are associated with the computed fields of the report and not the database fields in the view.

After you lay out the desired controls on the dialog, size the dialog by dragging its borders with the left mouse button to the size you want it to appear when the report is printed.  When the report prints, the dialog will be expanded in height to accommodate an OK and Cancel button at the bottom of the dialog.  Don't allow room for the buttons when you design the dialog.

Placing controls on the startup dialog

Controls are placed on a report dialog just as they are on a form.  The difference is that the fields you assign to the controls are report fields that you want the user to set a value for before the report prints.  If the user must enter a value, check the Required option when you define the report field (see Edit Computed Field dialog).  If a value is optional, don't check the Required option.

Hiding the startup dialog

To hide the startup dialog after you have designed it, double-click its system menu icon, or select the Hide command on the startup dialog's system menu.


Printing Envelopes

You can print addresses and other information on any size envelope that will fit in your printer.  To create a report for envelopes:

Select the New command on the File menu, then select the Report (detailed design) option.

There are several ways to design an envelope report.  Here is one example for laser printers, you may have a better way, depending on your printer limitations and other requirements:

On the specify an ID and description for the report

To be compatible with most laser printers:

set the page width to 11 inches

set the page height to 8½ inches

set the page orientation to landscape

set the page left margin to 11 inches minus the width of the envelope

set the page right margin to 0

set the page top and bottom margins each to half of 8½ inches minus the height of the envelope (  (8.5-H) / 2 ).

The area within the report margins should now equal the dimensions of the envelope.

Define the view for the report on the Edit View

The report design window is displayed with no elements showing.  The report starts with a default region that extends between the margins.  You don't need to change this.

Use the Elements command to add a new element for the return address.  Set the following options, leaving ones not mentioned unchanged:

Description	Return Address

Trigger	Detail Line

Region	Report Body

Page Break on	Before

Left Margin	(your call, about .25 inch)

Top Margin	(your call, about .25 inch)

check the option Don't print blank lines

Create another element for the main address following the first element

Description	Address

Trigger	Detail Line

Region	Report Body

Page Break on	None

Left Margin	use the left margin to position the address from the left edge of the envelope, or set the left margin to 0 and position the address with a tab stop

Top Margin	set the top margin to position the address the desired distance below the return address

check the option Don't print blank lines

Set the desired fonts for each address

Insert the database fields into the address element

Select the Display command on the Report menu to preview the layout

Note: The return address will usually be the same for all envelopes so you can type it into the report design.  If something is different each time you print envelopes, but will be the same for all envelopes printed during the session, you can use a startup dialog to enter the information at print time.


Data Exchange

Data exchange includes importing data into a Ad Hoc database from an external file generated by another application, and exporting data from a Ad Hoc database to an external file that will be used by another application.  Currently, Ad Hoc supports data exchange to and from:

Text files in the comma separated values (CSV) format

Text files in the fixed field format

To move data from another application, you must export it from that application in one of the above formats, then import it into Ad Hoc.  To move data from Ad Hoc to another application, you must export if from Ad Hoc in one of the above formats, then import it into the other application.  Most applications support importing and exporting with the CSV format.

To import or export data in Ad Hoc, you must design a form with a data exchange template.  (See Designing Forms.)

For help on importing data, see Importing Data.

For help on exporting data, see Exporting Data.


Comma Separated Values (CSV) Format

Data can exported to or imported from an external DOS text file in comma separated values (CSV) format.  The data is structured in records, just like a database table.  Each record is divided into fields.  The fields are stored in the same order within each record, and the records are stored sequentially in the file.

Records are separated by two characters, a carriage return (ASCII code 13), and a line feed (ASCII 10).

The file is (optionally) terminated with an end-of-file character (ASCII code 26).

The fields have the same order within each record, and  are separated by commas.

Fields can vary in length.

If the field value contains a comma, the entire field is enclosed in double quotes ("..,..").

The order of the fields within a record is defined by the data exchange template.

When Ad Hoc exports data in CSV format, it encloses all fields with double quotes (whether required or not) and separates them with commas.  It also writes the end-of-file character at the end of the file.


Fixed Field Format
Fixed-Field Format

Data can be exported to or imported from an external DOS text file in fixed-field format.  The data is structured in records, just like a database table.  Each record is divided into fields.  The fields are stored in the same order within each record, and the records are stored sequentially in the file.

Records are separated by two characters, a carriage return (ASCII code 13), and a line feed (ASCII 10).

The file is (optionally) terminated with an end-of-file character (ASCII code 26).

Each record is the same length (number of characters).

The fields are identical in length and position within each record

The order and size of the fields within each record is defined by the data exchange template.


Importing Data

To import data from an external file into a Ad Hoc database, you must design a form with an attached data exchange template.  The data view of the form must contain the same fields that are in the external file.  The same data exchange template can be used for both importing and exporting, however only the fields that belong to the root table of the data view can be imported.  Other fields in the import record are ignored.

To design a data exchange template, see:

Designing Data Exchange Templates

Designing Forms

The data view of the form defines which fields from the database can be updated when an import record is read.  The data exchange template defines how data in the import record matches the fields in the data view.

Restrictions on importing data

You can change data fields in existing records in the root table of the data view associated with the form only if the imported records contain the field(s) that is the root table's primary key.

You can add new records to the root table of the data view only if the imported records contain the field(s) that is the table's primary key and all of the table's required fields are contained in the imported records.

If you attempt to import two records with the same value in the primary key field(s), the first record will be added to the table (assuming a record with the same key does not already exist), and the second record will be treated as an update to the first.  In the current version of Ad Hoc, the user must make sure there are no duplicate primary key values before importing.

To import data from a file

1.	Display the form that contains the data exchange template designed for the record format of the external file.

2.	Select the Import command on the Form menu to display the Data Import dialog.

3.	Enter the name of the external file that you are importing, along with the other options on the dialog, then press Enter or click the OK button.

4.	Ad Hoc will display the progress of the import process in a window.

5.	If an error is encountered in an input record, the record will be displayed on the form for you to edit.  You can either correct the error and use the update command to import the record, or use the cancel command to discard the record.  If you have specified a suspense file, the discarded record will be added to the suspense file for later editing and import.

6.	When the import process is completed, click the OK button in the process window to close it and terminate the import process.


Exporting Data

To export data from a Ad Hoc database to an external file, you must design a form with an attached data exchange template.  The data view of the form must contain the fields that you want in the exported records in the external file.  The same data exchange template can be used for both importing and exporting, however all fields in the view will be exported, including fields from linked tables.

To design a data exchange template, see:

Designing a Data Exchange Template

Designing Forms

The data view of the form defines which fields will be read from the database.  The data exchange template defines how the data in those fields will be placed in the export record.

To export data to a file

1.	Display the form that contains the data exchange template designed for the record format of the external file.

2.	Select the Export command on the Form menu to display the Data Export dialog.

3.	Enter the name of the external file that you are exporting to, along with the other options on the dialog, then press Enter or click the OK button.

4.	Ad Hoc will display the progress of the export process in a window.

6.	When the export process is completed, click the OK button in the process window to close it and terminate the export process.


Designing Data Exchange Templates

Data exchange in Ad Hoc is implemented by importing and exporting records through a form.  A form contains the means of reading and writing records to the database.  By attaching a data exchange template to the form design, you can use the form to import (read) records into the database from an external file, or export (write) records from the database to an external file.  When you import records, you can use the form to display and edit them before they are stored in the database.

A data exchange template describes how the fields in the data view of the form are "mapped" to the data in the records of the external file.  Not all of the fields in the data view need to be defined in the data exchange template - only the ones you want to import or export.

There are some restrictions to importing data that you must be aware of when designing a template that will be used for import:

Only fields from the root table of the data view can be updated in the database, so only these fields will be imported.

An import record must contain the fields of the primary key of the root table.

If import records are to be used only to update information in existing database records, they need only contains the primary key field(s) and the fields to be updated.

If import records are to be used to add new records to the database, they must contain, as a minimum, the primary key field(s) and all required fields of the root table.

Only certain date formats available to data exchange templates can be used for importing.  See Data Exchange Template dialog.

To design a data exchange template

1.	Use an existing form, or design a new form for the data exchange process.  See Designing Forms.

2.	Put the form in design mode with the Design Mode Command on the Form Menu.

3.	Design the data view.  The data view of the form must contain all the fields to be imported or exported.

4.	If the form will be used for importing, there should be a control on the form for each field in the root table that will be imported.  This will allow editing of errors in the import record.

5.	Check the Data Exchange Template option on the Form Attributes dialog.

6.	Select the Data Exchange Template Command on the Form Design menu (or click the DX Template button on the Form Attributes Dialog) to display the Data Exchange Template dialog.

7.	Select the record format of the external file, and the other options on the Data Exchange Template dialog.

8.	Click the Layout button to display the DX Record Layout dialog.   Use this dialog to define the mapping of data in the records of the external file to the fields in the form's data view.  See DX Record Layout Dialog for details.

9.	If you are designing a template to import from an existing external data file, you can use the Sample Record feature on the DX Record Layout dialog to display a sample from the file to help design the layout.

10.	If you are designing the template to export data, you can define the sort specification and filter of the data view to determine the order and selection criteria of exported records.  See Defining Data Views.

11.	When you have designed the template, take the form out of design mode with the Leave Design Mode command on the Form Design menu.

12.	Save the form design with the Save command on the File menu.

13.	Test the design by exporting to a sample output file.  If the template is to be used for importing, verify that the output sample records match records that will be imported.


Getting Started

If you are a new user of Ad Hoc, getting started can be frustrating, particularly if you don't have previous experience with building and using databases.  The following topics will help you understand what Ad Hoc does and how you can apply it to your data management needs.

What is Ad Hoc?

Basic Concepts

Features of Ad Hoc Help

Learning to use Ad Hoc

Introduction to Databases


What is Ad Hoc?

Ad Hoc is a database management system - a program that allows you to organize and store data, and then retrieve it either on screen or in printed reports.  It can be used for simple applications, such as mailing lists, or more complex applications such as  customer information systems, product inventory systems, etc.

Ad Hoc lets you organize data and store it on your disk

Data is stored on your hard disk in a database, which is the total collection of all your data along with the definition of how it is structured.  The first step in using Ad Hoc is to decide what data you want to store, and how you want to organize it.  This determines the structure of your database, which is defined in the database's data dictionary.

Ad Hoc provides ways for you to enter data into the system

The primary way of getting data into the database is by typing it in using data entry forms.  A form is like a dialog box in any windows program, where there is a space to enter each data item.  You design the forms in Ad Hoc.  You can have as many forms as you like, and tailor them to a particular purpose.  For example, you may have a form for business contacts, that contains all the information you store on your contacts.  This form would be used to enter all the information for a new contact.  You may have another form containing just the address of the contact.  This form might be used to update address information for contacts in your database.

Ad Hoc lets you retrieve data in meaningful ways

A mass of data is no good unless you can retrieve it in a useful format.  There are several ways of getting data out of Ad Hoc.  You can design on screen-displays of data, either as display-only forms, or scrolling lists, that display your data in a row and column format.  You can also design printed reports.  Reports can also be displayed on the screen, either in a preview mode, which shows you what it will look like on the printed page, or in a format more tailored to the size of the screen.  List and report formats are also saved in the database for easy retrieval when you need them.

Ad Hoc also lets you export data from the database into formats that can be read and used by other programs.


Basic Concepts

Ad Hoc is a standard Windows program, and the documentation from Ad Hoc uses standard terminology for Windows.  If you are unfamiliar with Windows in general, you can refer to the Microsoft Windows User's Guide.  Ad Hoc is a multiple document interface program, which means that you can open smaller document windows within the main program window.

In Ad Hoc, the area of the main program window is called the Ad Hoc desktop.  On this desktop, you can open a number of document windows that we will refer to as desktop objects.  There are several types of desktop objects in Ad Hoc:

Forms	data entry windows

Lists	data display windows in scrolling row and column format

Report Design Windows	windows in which you can design a report

Report Display Windows	windows that display a report output

Tables Window	a window that lists the tables in your database, and allows you to change a table design or perform maintenance on a table

Process Windows	process window display the progress of a background process, such as a sort, a table rebuild, or a data exchange operation

To use Ad Hoc, you must first open a database.  When a database is open, you can work with the database by opening forms on the desktop to enter data, designing and printing reports, etc.  You can create as many databases as you want.  Usually a database contains all the information relating to a particular application.  If you are using Ad Hoc to store your personal information, (address lists, household inventory, etc.) you probably would keep all this information in one  database.  For a more detailed discussion of database terminology and concepts, see Introduction to Databases.

The commands on the File menu enable you to open and work with desktop objects.  With these commands you can start designing a new form, list or report, or open an existing object to use.

The commands on the Options menu allow you to tailor the way Ad Hoc works.  When the Tables Window is open, the commands on the Tables menu allow you to design and maintain the structure of your database.

Information in a database is stored in tables.  A table in Ad Hoc is represented physically by a file on your disk.  A disk file corresponds to each table in your database.  There are four files, called system files in Ad Hoc, that are contained in every database.  The names of these files depends on the ID you assigned when you created the database.  The first of these files is the file that contains the data dictionary.  The other three correspond to system tables that you will see listed in the Tables Window.

The system tables are:

_DDDATA	extra data dictionary information, such as field validation rules

_FORMS	form and list designs, saved desktop layouts

_REPORTS	report designs

The system files must all be in the same directory on your disk.  All other database files correspond to the tables that you define in the database, and can have any valid file name and be located in other directories or on other disks.


Features of Ad Hoc Help

See Also

(If you are unfamiliar with using on-line help in a Windows program, select the How to Use Help command from the Help menu at the top of this help window.)

The Help System for the current version of Ad Hoc serves the following purposes:

It is the User's Manual for Ad Hoc, taking the place of printed documentation

To help you learn how to use Ad Hoc

To help you perform a procedure with step-by-step instructions

To define the function of a menu command, dialog, or Ad Hoc desktop object

To provide a quick reference while you use Ad Hoc

Some of the special features that you should be familiar with are:

"See Also" Lists

In the title area of many topics, you will see a jump to another topic labeled "See Also".  Click this topic jump to view a pop-up list of other topics related to the one you are reading.  Issues referred to the topic you are reading may be covered in greater detail in a related topic.  Some topics also have a jump labeled "Procedures" in the title area.  This displays How To help related to the topic you are reading.

Graphic Hot Spots

Some topics contain pictures of Ad Hoc screens or other graphics.  When you move the mouse cursor over these graphics, there are areas where the cursor changes to the shape of a hand.  Click on these "hot spots" to view a pop-up description of the object or area in the graphic under the cursor.

The Glossary

The Glossary is displayed in a separate Glossary Window, so that you can keep it open as you read help to look up definitions of terms.  Use this feature to look up terms in the help text that don't have pop-up definitions.

Click on "Glossary" topic jump in the Reference section of the Help Contents topic to display the glossary in the main Help Window

Click the Glossary button on the Help Window button bar to display the Glossary in a separate window.

"How To" Help

The "How To" feature of Ad Hoc help is designed to help you quickly find the steps to perform a task.  How To topics are displayed in a separate window from the Help Window so that you can view the steps of a task in one window and detailed help on the task in the main window.  How To topics are colored dark red to distinguish them.  They are organized into related groups, and when you click on a How To topic, it is displayed in a pop-up window.

Click on the "Procedures" topic jump in the Reference section of the Help Contents topic to display How To topics in the main Help Window.

Click on the Procedures button on the Help Window button bar to display How To help topics in a separate window.

How To topics are meant to contain a short list of steps to carry out a task. Some of them help with tasks not covered in a main help topic.  Some are abbreviates of steps to perform a task and will refer to details in a main help topic.

How To topics contain topic jumps to main help topics in order to define a concept or refer to a more detailed explanation.  When you select one of these jumps, the main help topic is displayed in the main help window to allow you to quickly return to the How To topic.


Help Menu

Glossary Window

"How To" Window


Learning to Use Ad Hoc

The best way to learn how to use Ad Hoc is to read the User's Manual, which is this help system.  Of course, if you are like most people, you don't like to read manuals cover to cover, particularly if they are on-line and you can't find the covers.  So here are some alternate steps you can take to get started.

Read all the topics in the Getting Started section, to get familiar with the general concepts in Ad Hoc.

Starting at the Contents topic, browse the first topic of each of the main sections on databases, forms, lists, reports, etc.  To get familiar with where you can find information on a topic you need help on.

Play around with the sample database that comes with Ad Hoc.  Make a backup copy of the files in the ADHOC\DATA directory so you can restore the original state of the sample database, then start working with it.  Add data and print reports.  Change the design of the forms, create your own forms and reports, change the data dictionary, add your own fields and tables.

Try out all of the commands on the main menu bar.   When you drag the mouse over a menu selection, a short description of the menu command is displayed on the status line.  To display help on a menu command, open the menu by clicking on its title on the main menu bar, then use the cursor keys to move the highlight to the menu command you want help on.  Press the F1 key to display help on the highlighted command.

As you are working with the sample database, use the Help on Procedures references to find out how to perform a particular procedure.

After you have beat the sample database to death, create your own database and practice with data that is meaningful to you.


The Ad Hoc Main Window

See Also	Procedures

When you start Ad Hoc, the first window that you see is the Ad Hoc Main Window.

Click the mouse on the areas of the Ad Hoc window above to see a definition of each component of the main window.

The main area of this window (called the client area in Windows terminology) is referred to in Ad Hoc as the desktop.  Ad Hoc displays various desktop objects on the desktop, including data entry forms, lists report design windows,  and the Tables Window.


Menu Commands

Configuration Options

Tables Window

Getting Started


Window Title Bar

This area displays the application name, Ad Hoc, and if a database is open, the name of the database.


Main Menu

The main menu of Ad Hoc, contains the commands you use to open and work with databases, forms, and reports.


Desktop

The Ad Hoc Desktop, on which appear the desktop objects: forms, reports, the table status window, etc.


Status Bar

The status bar displays the state of various system wide options on the right, and status messages of the active desktop object on the left side.  When you are dragging the mouse across a menu, the status bar displays a description of the menu selection that is highlighted.


Design Mode Indicator

If the currently active form is in design mode, this area will display the word "DESIGN".


Record Locking Indicator

If record locking is in effect, this area will display "RL".


Data Change Notice Indicator

This area of the status bar will display "DBC"  (for Database Change) if the data change notification option is set.


Contents

Registration and License Information

Features of Ad Hoc Help

Getting Started

The Ad Hoc Main Window

Databases

Forms

Lists

Reports

Data Exchange

Database Maintenance

Reference

Procedures  (How To's)

Menu Commands

Keyboard Reference

Glossary

Technical Support and Questions


Registration and License Information

This program is SHAREWARE, it is not free!

You are authorized to use this evaluation version of Ad Hoc for a period of 21 days.  If you use the program after the 21-day evaluation period, you are required by law to register your copy and pay the registration fee for a license to use the software.  Your use of the product, even during the evaluation period, means that you agree to the terms of the software license agreement.

Benefits to Registering

How to Register Ad Hoc and Order Copies

Software License Agreement

Limited Warranty


Benefits to Registering

We hope you like Ad Hoc and will continue to use it after the 21-day evaluation period.  If you continue to use Ad Hoc after the evaluation period, you must register your copy and pay the registration fee to avoid being in violation of Federal copyright laws.

The additional benefits to registering your copy are:

You will receive a registered copy of the product ( the retail version) without the "Unregistered Copy" notice and reminders.  You will also receive a printed copy of the User's Manual, when and if it becomes available.

You will be eligible for telephone (or fax) technical support.

You will receive the next update version of the software for free, and will be notified of the availability of future updates.

In the initial release version of Ad Hoc, the evaluation version will have the same features as the registered version.  In future releases, the registered version of Ad Hoc will contain enhancements not in the evaluation version.

You will be able to contribute to the design of future releases with your comments and suggestions.  We thrive on the suggestions and requests of our users.

By purchasing a license to use Ad Hoc, you will help make it possible for us to continue to improve the product.


How to Register and Order Ad Hoc
How to Register Ad Hoc and Order Copies

You can order registered copies of Ad Hoc by mail. Send a check, along with the order form, to:

ExLogica
59 Golden Eagle Lane
Littleton, CO 80127-5750

The registration fee for Ad Hoc is $49.95 plus shipping and handling.  See the order form for details.

Payment must be in US Dollars, drawn on a US bank.

For information on ordering, quantity discounts, site licenses, or obtaining upgrades to the product, write the above address, or contact ExLogica at:

Voice / Fax 	(303) 933-8553

Compuserve	75136,1033


Software License Agreement

See Also

By installing and using this software, you agree to the following license agreement between yourself and ExLogica.  You should carefully read the following terms and conditions, and if you do not agree with them, do not use the software.

SHAREWARE version of Ad Hoc

The SHAREWARE version ("evaluation version") of Ad Hoc contains the title "Unregistered Ad Hoc" in the main window caption bar and the words "Evaluation Copy" in the main window client area.  This is the only version of Ad Hoc that may be distributed as SHAREWARE.  Other versions of Ad Hoc without this designation are retail versions (registered versions) that may be used only by licensed (registered) users.

You are hereby authorized to:

Use the evaluation version of the software for a 21-day evaluation period.

Make as many copies of the evaluation version of this software and documentation as you wish, as long as the copies include all of the files distributed in the evaluation package

Give exact copies of the original evaluation version to anyone for their evaluation, and distribute the evaluation version of the software and its documentation in its unmodified form via electronic media.

You are specifically prohibited from charging, or requesting donations, for any such copies, however made; and from distributing the software and/or documentation with other products or services (commercial or otherwise) without prior written permission.

You may not use Ad Hoc after the 21-day evaluation period without first registering your copy and paying the license fee.  Unregistered use of Ad Hoc after the evaluation period, by any person, business, corporation, government agency, or any other entity, is strictly prohibited and is in violation of federal copyright laws.

Use of software

Each registered copy of Ad Hoc may be used by only one person on one or more computers or workstations, or may be installed on a single computer for use by several people.  You may install and use Ad Hoc on a network, provided that you have purchased individual licenses for the software covering all workstations that will access the software through the network.

You may not modify or patch the Ad Hoc executable files in any way.  You may not de-compile, disassemble, or otherwise reverse engineer the software in this product.

You may not sell or otherwise distribute Ad Hoc, enhancements to Ad Hoc, or Ad Hoc data dictionary or database files, or designs for such files, to anyone without written permission from ExLogica.

SHAREWARE Vendors

You may distribute only the evaluation version of Ad Hoc, as described above.  No fee, charge, or other compensation may be requested for distributing copies of Ad Hoc, except:

Operators of electronic bulletin board systems may make Ad Hoc available for downloading only if the above conditions on distributing copies are met, and no fees are charged specifically for downloading Ad Hoc.  The only permissible charges are the time-dependent charges for use of the bulletin board.

Vendors of user-supported or shareware software may distribute Ad Hoc only with written permission from ExLogica.  Vendors may charge a disk duplication and handling fee, which, when pro-rated to the Ad Hoc product, may not exceed eight dollars.

Non-profit user groups may distribute copies of the evaluation version of Ad Hoc to their members, without specific permission,  subject to the above conditions stated under "Evaluation version of Ad Hoc".  Non-profit groups may collect a disk duplication fee not to exceed five dollars.

U.S. Government Restricted Rights

Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subdivision (b)(3)(ii) of the Rights in Technical Data and Computer Software clause at 252.227-7013 (DFARS 52.227-7013).  Contractor/manufacturer is ExLogica, 59 Golden Eagle Lane, Littleton, CO 80127.

Evaluation and Registration

Ad Hoc is not free software.  This license allows you to use the software for evaluation purposes without charge for a period of 21 days.  If you use this software after the 21 day evaluation period, you must register it and pay the license fee.

This license agreement is governed by the laws of the State of Colorado.


Limited Warranty


Menu Commands Reference

File Menu

Edit Menu

Options Menu

Report Menu

Database Menu

Tables Menu

Window Menu

Help Menu

Form Menu

Form Design Menu

List Menu Commands

List Design Menu


File Menu

Command Summary
New	Print Report
Open	Display Report
Close	Printer Setup
Delete	Design Report
Form Links	Delete Report
Save	Database
Save Desktop	New Database
Read From File	Exit


Edit Menu

Command Summary


Options Menu

Command Summary

Desktop Configuration

Database Options

Confirmation Options

FastMenu Options

Diagnostics Options


Database Menu

Command Summary

Open Database

Close

Create New Database


Tables Menu

Command Summary	Edit Database Information
Show Tables Window	Rebuild Table File
Update Tables Window	Empty Table File
New Table	Run Database Diagnostics
Edit Table Definition	Run Table Diagnostics
Delete Table


Report Menu

Command Summary	Total Fields
Elements	Computed Fields
Regions	Insert Field
Layout	Print
Edit Startup Dialog	Display
Data View	Run Diagnostics
Report Breaks


Window Menu

Command Summary


Help Menu

Command Summary


File Menu Command Summary

New

Creates a new desktop object.  Desktop objects include forms, lists, and reports.  An empty window for the object is opened on the desktop.  You use the pop-up design menu for the object to design its layout, data view, etc.

Open

Opens an existing form, list, desktop layout, or report design stored in the forms table.

Close

Closes the active object on the desktop.

Delete

Deletes a form, list, or desktop layout from the database.

Form Links

Links the active form or list to other forms or lists on the desktop.  The active form becomes a master to the linked forms, controlling the data that is displayed in the linked form.

Save

Saves the design of the currently active desktop object in the database.  This command saves forms, lists, or report designs.

Save Desktop

Saves the current layout of the desktop.  The desktop layout is saved under a unique ID that you can use later to recall the layout.  The layout saved includes all forms and lists currently on the desktop, their current size and position on the desktop, and all links defined between them.

Read From File

Reads a desktop object (form, list, or report) from a DOS file and loads it onto the desktop.

Save To File

Saves a desktop object (form, list, or report) to a DOS file.

Print Report

Prints a report selected from the reports table.

Display Report

Display a report on the screen in a Report Display Window.

Printer Setup

Selects and configures a printer connected to your system that will be used by Ad Hoc to print reports.

Design Report

Opens a report design window for a report that has been stored in the reports table.

Delete Report

Deletes a report design stored in the reports table.

Exit

Closes all open desktop objects and exits Ad Hoc.

When no database is currently open, most of the above commands do not appear on the file menu, and the following commands are added.  A list of the most recently opened databases (up to four) appears at the bottom of the menu.  To open one of these databases, select its entry.

Open Database

Opens a database.  This command appears on the File Menu only when there is no database currently open

New Database

Enables you to create a new database.  This command appears on the File Menu only when there is no database currently open.


New Command  (File menu)

Use the New command on the File menu to create a new desktop object.  This command displays a dialog containing a list of the types of objects you can create:

Object Type Description
Form	A data entry form with edit controls for editing records.  Each control on the form displays a field from the view associated with the form.  A form displays one record at a time.
List	A scrolling list that displays several records at a time.  Each column of the list corresponds to a field in the view associated with the list.
Report (Quick Setup)	A report design window, with a Quick Report Setup Dialog that helps you quickly set the basic design for a standard report style.
Report (Label Style)	A report design window, with a label-style layout dialog.  (See Label Report Layout Dialog)
Report (detailed design)	A report design window that enables you to design a report from scratch.
To select a new object type from the dialog, double click on the desired type, or use the cursor keys to highlight the desired type, then either click on the OK button or press the ENTER key.

To put away the dialog without selecting an object, click on the CANCEL button, or press the ESCAPE key.

When you select an object type, a new object of that type will be displayed on the screen.  You can then design the layout, database view, and other attributes of the object and then save it in the database.


Open Command  (File Menu)

Use the Open command on the File menu to select a form, list, or desktop layout and open it on the desktop.  When you select this command, Ad Hoc displays the Open dialog.  This contains a list of the forms, lists, and desktop layouts stored in the database sorted by the long description given the object when it was designed.  The type of each object is also displayed.  Check boxes below the list allow you to select the types of objects that will appear in the list.

To select and open an object, double click on the list entry, or highlight the entry in the list and either press the ENTER key or click the OK button.  To close the Open dialog without selecting an object, press the ESCAPE key, or click on the CANCEL button.

Forms and lists will be displayed on the desktop at the position and with the size they were given when designed.  If you open a desktop layout, the objects will be displayed with the size and position they had when the desktop was saved.


Close Command  (File Menu)

Use the Close command on the File menu to close the currently active desktop object.  The active desktop object is the one with the highlighted border and title bar that is responding to keyboard input.  If you have changed the design of the object since it was last saved, Ad Hoc will ask you if you want to save the object (Form, List, Report, etc.).  Your response to this can be:

Response Action
Yes	The object design changes will be saved in the database and the object will be removed from the desktop.
No	The design changes to the object will not be saved.  The object will be removed from the desktop and the design changes will be lost.
Cancel	The object will not be removed from the desktop, changes will not be saved.


Delete Command  (File Menu)

Use the Delete command on the File menu to delete a form, list, or desktop layout from the database.  When you select this command, Ad Hoc displays the Delete dialog, containing a list of the forms, lists, and desktops stored in the database.  Below the list are check boxes that you can use to select the type of objects that appear in the list.

Double click on the entry in the list that you want to delete from the database, or highlight the entry and either press the ENTER key or click the OK button.  Press the ESCAPE key or click the Cancel button to close the dialog box without deleting an object.

When you select an object, Ad Hoc will ask you if you want to delete it.  Respond Yes to delete the object, No to leave it in the database.

Warning:  When you delete an object from the database, it cannot be retrieved, unless you have made a backup of your database


Form Links Command
Form Links Command  (File Menu and Form Menu)

Use the Form Links command to display the forms or lists that are linked to the currently active form (or list), and to edit the links.  This command will link two forms together so that the contents of the record displayed in one form (the master form) controls the records that are displayed in the other form (the linked, or dependent, form).  The Form Links command can also be used to edit an existing link between two forms or to remove a link.

In Ad Hoc, two form objects on the desktop can be linked together to display related information.  The values of data fields defined in the view of the master form are used to filter the view of the linked form.  Usually the linked form would be a list; a linked list would display records linked to the record displayed on the master form.  Any two forms on the desktop can be linked together if their data views share common fields.  For example, suppose in an order entry system that the Customer Master form is displayed on the desktop, and as you work with the customer records you wish to see a list of recent orders for the customer.  You could open a list form on the desktop that displays records from the Order file, and link list to the Customer Master form so that only orders for the customer record displayed on the Customer Master Form appear in the Orders list form.  If this were a configuration that you used often, you could save it as a desktop layout in the database.

To link two forms

1.	Make sure that both forms are open on the desktop.

2.	Make sure that the form or list that is to be the master is active.  (One way to do this is to click on it. )

3.	Select the Form Links command.

4.	Describe the link on the Form Links dialog.

5.	Close the dialog with the OK button or by pressing ENTER.

The forms will be linked until you remove the link with the Form Links command, or until one or both of the forms are closed.


Save Command  (File Menu)

Use the Save command when you have designed a new desktop object (form, list, report, etc.) or have changed its design and want to save it permanently in the database for later use.  When the design of a desktop object has changed, or the object is in design mode, the Save command will be enabled.  When it is selected, the currently active object's design is saved in the database under the ID that you gave it.

The Save Command applies to the following desktop objects:

Object Type Saved in Table ID specified on
Form	_FORMS	Form Attributes dialog
List	_FORMS	List Attributes dialog
Report	_REPORTS	Report Layout dialog
Before you can save the design of an object, you must have given it a unique ID on the design dialog specified above.  Objects without IDs cannot be saved.  If another object already in the table already has the ID you specified, Ad Hoc will warn you that the current object cannot be saved because it has a duplicate ID.  In this case, return to the design dialog and change the ID.

Hint

If you want to save a copy of a form, list, or report, and perhaps make some slight changes later to the copy, change the ID and save it as a different object.  It would be wise to also change the long description of the object so that you can distinguish them on selection lists.


Save Desktop Command  (File menu)

Use the Save Desktop command to save the current desktop layout.  The desktop information saved includes the position and size of all form and list desktop objects as well as all links existing links between them.

When you select this command, Ad Hoc displays the Save Desktop dialog, which allows you to enter a unique ID under which the desktop layout will be saved, and a long description for the layout.  Enter both the ID and description then respond OK to save the layout, or respond Cancel if you decide not to save the desktop layout.

If you have given the desktop an ID that is already in use by a desktop, Ad Hoc will ask if you want to replace the old desktop with that ID with the current desktop layout.  If you answer Yes, Ad Hoc will save the current desktop, replacing the old one.  If you answer No, the current desktop will not be saved.

If you supply a desktop ID that is already used for another kind of object, Ad Hoc will not let you save the desktop with that ID.


Read From File Command   (File Menu)

Use the Read From File command on the File menu to read a desktop object into Ad Hoc from an external file and display the object on the desktop.  The object can subsequently be saved in the database with the Save command.  The only files that can be read using this command are files that were previously created using the Save to File command.

When you select this command, Ad Hoc displays the Windows Open File dialog.  Two types of files (distinguished by their filename suffix) can be read using this command:

File Type Object Type
.FRM	Forms and lists
.RPT	Reports
To read a file

1.	Enter the full pathname of the file, including the correct extension, in the File Name edit, or

2.	Select either Form Template or Report Template in the List Files of Type control.  This will display the all the files of the selected type in the current directory.

3.	Select a file by double-clicking it, or highlighting it and clicking OK (or pressing ENTER).

4.	You can use the Directories list or the Drives list to change the current directory.

When you select a file, Ad Hoc will determine that it is a valid file type, and that is consistent with the currently open database.  If these checks are successful, the file is read in and the object is displayed on the desktop.

Use this command with the Save To File Command to make a copy of an object design in a separate file that can be used at a later time either by the same database, or a copy of the database (it must have the same ID) on another machine.

Note:  Ad Hoc will not read a file into a database with a different ID than the one from which the file was written.


Save To File Command  (File menu)

Use the Save To File command on the File menu to save an object on the desktop to an external file.  Make sure the object you want to save is active, then select the Save To File command.  Ad Hoc will display the Windows File Save As dialog.  Navigate the directory in which you want to save the file and enter the filename.  Ad Hoc will supply the proper extension.  If you enter a filename that is already in use, Ad Hoc will ask you if you want to replace the old contents of the file.  If you respond Yes, the old contents will be discarded and replaced by the object you are saving.  If you don't want to lose the old contents, respond No, and enter a different file name.

Two types of files are saved with this command:

File Type Object Type
.FRM	Forms and lists
.RPT	Reports
Along with the object description, Ad Hoc saves the database ID and version number, to insure that the object will be compatible with any database that tries to load it.

Use this command with the Save To File Command to make a copy of an object design in a separate file that can be used at a later time either by the same database, or a copy of the database (it must have the same ID) on another machine.

Note: objects saved with this command are saved to a DOS file, and not saved in the database (unless you also use the Save command).  An object is not considered saved by Ad Hoc unless you save it with the Save command.


Print Report Command
Print Report Command  (File Menu)

Use the Print Report command on the File menu to select and print a report.  When you select this command, Ad Hoc displays the Print Report dialog, which contain all reports in the database listed alphabetically by their long description.

To print a report in the list, double click on its description, or use the cursor keys to highlight the report and click on the OK button or press ENTER.  If you decide not to print a report, click on the Cancel button, or press ESC.

Before you print a report, you may want to select and configure a printer using the Printer Setup command.

To print a report that is not stored in the database but is in an .RPT file, first load the report with the Read From File command.  This will load the report design into a report design window.  You can then print the report using the Print command on the Report menu.


Display Report Command
Display Report Command (File Menu)

Use the Display Report command on the File menu to open a report display window .  When the report display window first opens, a Print Report dialog is displayed for you to select a report.    The selected report is generated and displayed in the report display window.

This command also appears on the Report menu, and on the pop-up menu of the report design window.  When you select this command from a report design window,  a  report display window is attached to the report you are designing, and can display only that report.

To display a report that is not stored in the database but is in an .RPT file, first load the report with the Read From File command and then display the report using the Display command on the Report menu.

See Report Display Window and Report Display Window Options Dialog for details on using a report display window.


Printer Setup Command
Printer Setup Command  (File Menu)

Use the Printer Setup command to select and configure a printer that will be used to print reports from Ad Hoc.  You may never need to use this command if you have only one printer connected to your computer and don't want to change its configuration.

When you select this command, Ad Hoc displays the Printer Setup dialog, which contains a list of printers attached to your computer.  To select a printer, double click on its entry, or highlight the entry and click the OK button  (or press ENTER).

To change the configuration of the selected printer, click on the Setup button, or press Alt-S.  This will display a printer configuration dialog that is specific to the printer you selected.  This dialog enables you to change printer settings such as paper size, paper source, number of copies, etc.

The printer configuration changes you make are local to Ad Hoc, and will not be seen by other programs.  When you exit Ad Hoc, the configuration changes will be discarded.  Reports can be designed to override some of the printer settings (such as portrait vs. landscape orientation).  These settings are changed only while the report is being printed.


Design Report Command
Design Report Command  (File Menu)

Use the Design Report command to open a report design window and display a previously saved  report design.  This command displays the Design Report dialog, which lists all the reports saved in the database alphabetically by their long description.

To display the report design on the desktop, double click on the report in the list, or highlight the report with the cursor keys and click the OK button or press ENTER.  If you decide not to open a report design, click the Cancel button or press ESC.


Delete Report Command
Delete Report Command  (File Menu)

Use the Delete Report command to delete a report design from the database.  This command displays the Delete Report dialog, which lists the reports in the table alphabetically by their long description.  To delete a report, double click on its entry, or highlight it and click the OK button or press ENTER.  If you do not want to delete a report, click on the Cancel button, or press ESC.  Ad Hoc will ask you to confirm the deletion.

Warning:  When you delete a report from the database, it cannot be retrieved, unless you have made a backup of your database


Exit Command  (File menu)

Use the Exit command to exit the Ad Hoc program.  If there are desktop objects with design changes, Ad Hoc will ask if you want to save the changes for each desktop object separately:

Respond To
Yes	Save the changes and exit
No	Discard the changes and exit
Cancel	Cancel the exit and return to Ad Hoc (changes will not be saved at this time)


Edit Menu Command Summary

The Edit Menu is a standard Windows menu that allows you to cut and paste information on the screen.  The edit menu commands operate in Ad Hoc to cut and paste text in the edit and textbox controls on forms.

Undo

Reverses the last cut, copy, paste, or delete action.

Cut

Copies the selected text or object to the Windows clipboard, and then deletes it from Ad Hoc

Copy

Copies the selected text or object to the Windows clipboard

Paste

Pastes the contents of the Windows clipboard into the location specified by the user.  If pasting text, the text on the clipboard is inserted at the blinking cursor in an edit or textbox control on a form.  If text is selected in the control, it is replaced by the contents of the clipboard.

Delete

Deletes selected text in a form edit or textbox control.


Options Menu Command Summary

Desktop Configuration Options

The Desktop Configuration command displays the Desktop Configuration dialog, which enables you to set options concerning how the desktop is saved until the next Ad Hoc session, and how keystrokes can be used to move to desired entries on lists.

Database Options

The Database Options command displays the Database Options dialog, which enables you to select options for the operation of the database manager.

Confirmation Options

The Confirmation Options command displays the Confirmation Options dialog, which enables you to select which database operations Ad Hoc will confirm with you before it proceeds.

FastMenu Options

The FastMenu Options command displays the FastMenu Options dialog, which enables you to tailor a pop-up menu that appears when you click the right mouse button on the Ad Hoc Desktop.  This menu allows you to quickly select a form to display or report to print.


Desktop Configuration Options

The Desktop Configuration dialog is displayed by selecting the Desktop Configuration command on the Options menu.  Use the Desktop Configuration dialog to set the way the Ad Hoc desktop is displayed when you start the program, and to select the method by which keystrokes help you to find a desired entry on a list.

Dialog Options

Open with last database

If this option is checked, Ad Hoc will remember which database is open when you exit the program, and will reopen this database the next time you start Ad Hoc.  If this option is not checked, Ad Hoc will not open a database automatically the next time you start it.

Save window size and position

If this option is checked, Ad Hoc will remember its main window size and position on the screen, and will appear with the same size and in the same position on the screen the next time you start Ad Hoc.  If this option is not checked, Ad Hoc will start with a default size and position for its main window.  The default is:  the top of the Ad Hoc window will be at the top of the screen, the width will be the full width of the screen, and the bottom of the window will extend down almost to the bottom of the screen.  You can re-size and move the Ad Hoc window after Ad Hoc starts.

Save Desktop

If this option is checked, Ad Hoc will save the desktop that is current when you close a database, and will re-display this desktop layout the next time you open that database.

No Keystroke Navigation

When you select this option, all forms of keystroke navigation on lists are turned off.  You can still move the highlight on the list with the up and down arrow keys, and the Home, End, PgUp, and PgDn keys.

Progressive Key Navigation

Select this option if you want to use progressive keystroke navigation on  all lists.

Single-key (Windows standard)

Select this option if you want Ad Hoc lists to work like standard list boxes that you find in dialogs in most Windows programs.

Reset Search with SPACE BAR

The SPACE BAR is normally used to reset a search key with the progressive keystroke navigation option.  Turn this option OFF (uncheck it) If you want to include spaces in your search string.  If this option is turned off, you can must reset the search string by holding down the SHIFT key and typing the SPACE BAR.


Database Options

The Database Options dialog is displayed by selecting the Database Options command on the Options menu.  It enables you to set various operating options for the Ad Hoc database engine.

Dialog Options

Record Locking

This option determines whether record locking will be in effect when Ad Hoc retrieves records from the database in order to update them.  When record locking is in effect and  you make changes to a record on a form, Ad Hoc locks the record so another user cannot update the same record until you are finished with it.  If you are editing a record on one form, record locking also keeps you from making changes to the same record on another form until you have accepted the changes on the first form.

Note: Record locking will not be in effect on a stand-alone computer, even though this option is checked, unless you have run the DOS SHARE.EXE program before you start Windows.

For proper operation of Ad Hoc, whether or not you want record locking,  you must run SHARE.  It is recommended that you include a line in your AUTOEXEC.BAT file to run SHARE.EXE, so that share is loaded each time your computer is booted.  If you start Windows in your AUTOEXEC.BAT file, make sure the command to run share is before the command to run Windows.

Send Data Change Notices

Set this option if you want changes that you make in one form or list to be immediately displayed in all other open forms or lists.

With this option on, whenever a change is made to a record in a database table, either by editing a record on a form, or deleting or adding a record, or some other change to the database caused by a process running in the background, the change will be immediately reflected in all forms and lists open on the desktop, as well as in the Tables Window.

Note: In Ad Hoc version 1.1, a form or list is updated by a data change notice only if it was caused by a change in a field of the root table of the data view.

If this option is off, changes to data made on one form will not be displayed in other forms until you reload the changed record(s) into the form with a Next Record, Previous Record, etc. command.  It is recommended that you leave this option ON.


Confirmation Options

The Confirmation Options dialog is displayed by selecting the Confirmation Options command on the Options menu.  It enables you to select the operations that Ad Hoc will confirm with you before it carries them out.

Dialog Options

Updating a database record

Select this option if you want Ad Hoc to ask you to confirm changes that you have made to a record before those changes are put into the database.  Changes you have made to a record on a form are updated when you move to another record on the form, start a new record, or close the form.  If you don't select this option, the changes are updated automatically.

Deleting a database record

Select this option if you want Ad Hoc to confirm your request to delete a record on a form or list.

Rebuilding a table

When you request that a database table be rebuilt with the Rebuild Table command, Ad Hoc will ask you to confirm the operation if this option is set, otherwise it will immediately start the rebuild.

Redefining a table that has records

When you select the Edit Table Definition command for a table that has records in it, Ad Hoc notifies you that the table has records and it may have to be rebuilt if you make certain changes.  This notification will take place if this option is set.

Closing a database

Set this option if you want Ad Hoc to ask you to confirm the closing of a database whenever you use the Close Database command, or before closing the current database when you ask Ad Hoc to open a different database.


FastMenu Options

Select the FastMenu command on the Options menu to display this dialog.  The FastMenu Options dialog enables you to tailor a pop-up menu that appears whenever you click the right mouse button when the cursor is over the Ad Hoc desktop.  This menu  contains selections that make it easier to quickly open a form or print a report.  You can select any or all of the following to appear on this menu

Dialog Options

None

Check this option to un-check all the others.  With no options selected, the pop-up menu will not appear.

Open Dialog (Forms)

Check this option to place an Open Form command on the pop-up menu.  This command has the same action as the Open command on the File menu.

List of Recent Forms

Check this option if you want the pop-up menu to include the most recently opened forms or lists in the current database.  When you open a form or list, it is added to the top of the recent forms list.  When you select one of these entries when the pop-up is displayed, the corresponding form or list will be opened.  When you open a form this way, Ad Hoc will place the form on the desktop so that its upper left edge is a close as possible to the point where you pressed the right mouse button.  It will adjust this position to try to display all of the form or list.

Ad Hoc keeps track of the most recent forms opened for each database you have created.

Design Report Dialog

Check this option if you want the pop-up menu to include a Design Report command, which will have the same action as the Design Report  command on the File Menu.

Print Report Dialog

Check this option if you want the pop-up menu to include both a Print Report command, which will have the same action as the Print Report command on the File Menu, and a Display Report command, which will have the same action as the Display Report command on the File Menu.

List of Recent Reports

Check this option if you want the pop-up menu to include the most recently printed reports in the current database.  When you print, design, or display a report, it is added to the top of the list.  Selecting one of these entries when the pop-up is displayed will cause the corresponding report to be printed, displayed, or loaded into a Report Design Window.

Ad Hoc keeps track of the most recent reports for each database you have created.

Recent Report Options

If you select the "List of Recent Reports" option, you can further select what will be done to a report selected from the recent list.  The options you can select are

Print	to print the report

Display	to display the report output in a report display window

Design	to open a report design window for the report

If you select only one of these options, the corresponding action will appear before the report name on the FastMenu.  (for example "Print Employee Report").  If you select one or more of these options to appear on the FastMenu, a further level of menu will be appended to each recent report entry on the FastMenu, containing the options you select.

Maximum number of recent forms

If you have checked the recent forms options, this entry will determine the maximum number of recent forms that will appear on the pop-up menu.  You can select any number from 1 to 6 recent form menu entries.

Maximum number of recent reports

If you have checked the recent reports options, this entry will determine the maximum number of recent reports that will appear on the pop-up menu.  You can select any number from 1 to 6 recent report menu entries.


Diagnostics Options
Diagnostics Options Dialog

See Also

The Diagnostics Options dialog enables you to set the error severity level that will cause an automatic diagnostic test to display its results.  Whenever you open a form, list, report window, or database, Ad Hoc runs a diagnostics check on the integrity of the design.  If errors are found, Ad Hoc displays a window with the results of the diagnostics if the severity of problems exceeds a threshold that you set.  This lets you quickly tell if you have a conflict between a form design, for example, and the design of the database fields used on the form.

The Diagnostics Options Dialog lets you set the error threshold independently for Forms (and Lists), Reports, and Databases.  These options do not affect the display of results when you select a command to run a diagnostics check.

Level	Diagnostics are displayed when

Fatal Errors	Only when fatal errors are detected

Errors	When fatal or other errors are detected

Warnings	Whenever any anomaly is found that may cause a problem

Always	Always, even if there are no errors

The pop-up menus on forms, lists, report design windows, and report output windows also contain a Run Diagnostics command, to allow you to check the design of an object at any time.


Diagnostics

Diagnostics command


Database Menu Command Summary

The Database Menu appears only when a database is open.  The most recently opened databases (up to four) appear at the bottom of this menu.  To open one of these databases, select its entry.

Open Database

Displays the Open Dialog to enable you to open a database.

Close

Closes the currently open database.

Create New Database

Enables you to create a new database.


Open Database Command  (Database Menu)

Use the Open Database command on the Database menu to change the database that you are working with.  When no database is currently open, this command appears on the File menu.

If there is a database already opened, Ad Hoc will ask if you want to close it.

Respond To
Yes	Close the currently open database and select a new one to open
No	To cancel the command
When you close the current database, all open desktop objects will be closed.  If the design of any of these objects has been changed, Ad Hoc will ask you if you want to save the design.  You have the same choice of response as for the Close command on the File menu.

If you proceed to open a database, Ad Hoc will display the Open File dialog, allowing you to select a data dictionary file that contains the description of the database you want to open.  A data dictionary file has the same name as the database ID, followed by a .DDF extension.  You can use the Open File dialog to navigate to the directory in which the desired database is located, then select its data dictionary file.  Ad Hoc will open the selected database and display its description in the title area of the Ad Hoc window.


Close Command (Database Menu)

Use the Close command on the Database menu to close the currently open database.  Ad Hoc will ask you to confirm that you want to close the database.

Respond To
Yes	Close the currently open database
No	To cancel the command
When you close the current database, all open desktop objects will be closed.  If the design of any of these objects has been changed, Ad Hoc will ask you if you want to save the design.  You have the same choice of response as for the Close command on the File menu.


Create New Database Command
Create New Database Command  (Database Menu and File Menu)

Use the Create New Database command to create a new database.  If a database is currently open, this command appears on the Database menu.  If no database is open, this command appears on the File menu.

If a database is open when you select this command, Ad Hoc will ask you if you want to close the current database.  If you answer NO, no action is taken.  If you answer YES, the current database is closed.

The New Database dialog is displayed, if you fill out this dialog and accept it by pressing ENTER or clicking OK, the new database is created.  If you cancel this dialog by pressing ESC or clicking Cancel, no database is created.

To create a new database, you must supply a unique ID for the database, a long description, and the pathname of a directory in which the database resides.  (See Creating a Database).

When the database is created, the system tables are created and the Tables Window is displayed.  The status of the system tables will be displayed in the Tables Window.  At this point you can begin defining tables for the new database.


Tables Menu Command Summary

The Tables Menu is associated with the Tables Window.  When the Tables Window is not displayed on the desktop, the only command enabled on the Tables Menu is Show Tables Window.  When the Tables Window is open on the desktop, the first command on the menu becomes Hide Tables Window, and the other commands are enabled as appropriate.

Show (Hide) Tables Window

Displays (opens) or closes the Tables Window.

Update Tables Window

Updates the status information displayed in the tables window.

New Table

Enables you to define a new table for the database.

Edit Table Definition

Enables you to change the definition of a table in the database.

Delete Table

Enables you to delete a table definition from the database.  This command optionally enables you to delete the file associated with the table definition.

Rebuild Table File

Enables you to rebuild a damaged database table file.  This command creates a new table file and copies records into it from the old table file.  If the copy is successful, the old file is deleted.  Otherwise, the new file is deleted and the old file remains unchanged.

Empty Table File

Removes all of the information stored in a table.  This command deletes the old table file and creates a new empty file for the table.

Edit Database Information

Enables you to change the general design attributes of the database, such as its description.

Create New Database

Enables you to create a new database.

Run Database Diagnostics

Runs a diagnostics test on the design of the database.

Run Table Diagnostics

Runs a diagnostics test on the design of the table selected in the Tables Window.


Show Tables Window Command
Show Tables Window Command  (Tables Menu)

Use the Show Tables Window command to display the Tables Window on the desktop.  The Tables Window lists the tables in the database along with status information on each.  When the Tables Window is displayed, the other commands on the Tables Menu are activated, allowing you to add, edit, or delete table definitions from the database, and perform maintenance on table files.

When the Tables Window is displayed, this command becomes Hide Tables Window, in which case it closes the Tables Window.  You cannot close the Tables Window if it is performing a process, such as translating a table, or rebuilding a table.


Update Tables Window Command
Update Tables Window Command  (Tables Menu)

Use this command to cause Ad Hoc to update the table status information displayed in the Tables Window.  If you suspect that the status of a table has changed since you opened the Tables Window, you can use this command to update the status display.

Ad Hoc will automatically update record counts for the tables as records are added or deleted from the database.


New Table Command
New Table Command  (Tables Window)

See Also

Use the New Table command to add a new table definition to the database.  The Tables Window must be open before you can select this command.  The New Table Command displays the Database Table dialog, with which you design the attributes of a new table.  In order to add a new table, you must fill out this dialog, defining the fields of the table, and at least one index (the primary key).

To add a new table to the database

1.	Select the New Table command

2.	Describe the table and its fields, indexes, and links on the Database Table dialog.

3.	Click the OK button on the Database Table dialog, or press ENTER to accept the entries you have made

4.	Ad Hoc will create a new empty file for the table, and insert the table in the Tables Window list

Once you have added a new table definition to the database, you can design forms, lists, and reports using the table, and enter information into the table.


Design a new table


Edit Table Definition Command
Edit Table Definition Command  (Tables Menu)

See Also

Use the Edit Table Definition command to change the definition of a table in the database.  This command is available when the Tables Window is displayed, and when there are no other objects on the desktop, including forms, lists, and reports.  This commands enables you to examine or change the definition of the currently selected table in the Tables Window.  See Database Table Dialog for details on editing the table definition.

You can change the definition of a database table at any time, including adding, changing, and removing fields, indexes, and links to other tables.  But you must be careful of the following:

Ad Hoc does not check forms, lists, reports, or link definitions for other tables to see if they would be affected by changes you make in a table.  Make sure your changes do not affect these objects, or they will not operate properly.

Do not delete a field if you have forms with controls associated with the field, or if the field is used on a report.  If you do, make sure you change the design of the forms and reports that reference the deleted field.

Do not change the primary key (the first index) if you have defined links in other tables that link them to this table.  If you must change the primary key, make sure you change the link definitions in the other tables.

If you change the file name or path name in the table definition, Ad Hoc may not be able to find the table file, unless you also rename the table file (using Windows File Manager).

Some changes that you make to a table definition require the table to be rebuilt.  Examples of these are adding, changing, or deleting fields from the tables, and changing the index definitions.  If you make these changes and accept them by clicking OK on the Database Table dialog, Ad Hoc will warn you that the table will have to be rebuilt and ask you if you want to proceed.  If you respond YES, Ad Hoc will proceed with rebuilding the table.  If you answer NO, you will return to the Database Table dialog.  At this point you can Cancel the changes, and no changes will be made to the table definition.

Some changes do not require the table to be rebuilt, and if you accept these changes by clicking OK or pressing ENTER, Ad Hoc will incorporate the changes into the data dictionary and update the status display in the Tables Window.

If Ad Hoc determines that a table must be rebuilt, and you allow it to proceed, a process window will open on the desktop, displaying the progress of the rebuild.  You can cancel the rebuild and discard the changes by clicking on Cancel in this window, or you can wait until the process is complete and click on OK (or press ENTER).  While a table is being rebuilt, you cannot open any other desktop objects (forms, lists, reports) or exit Ad Hoc.  You can edit or rebuild another table, however.


Delete Table Command
Delete Table Command  (Tables Menu)

Use the Delete Table command to delete a table from the database.  This command is available if the Tables Window is displayed and no forms, lists, or reports are open on the desktop.  This command deletes the table that is currently selected in the Tables Window.

If you select this command, Ad Hoc will ask you to confirm that you want to delete the table.  If you respond YES, the table definition will be deleted.  If a file is associated with the table, Ad Hoc will ask you if you also want to delete the file.

Warning: Once a table definition and the table file have been deleted, all data stored in the table will be lost.  You can only recover if you have backed up your database.  Use this command carefully.

Do not delete a table if it or any of its fields are referenced in a form, list, or report, or if it is referenced in a link defined in another table.  If you do delete the table, all references to it must be removed from these objects.  Ad Hoc does not check this for you.


Rebuild Table File Command
Rebuild Table File Command  (Tables Menu)

See Also

Use the Rebuild Table File command to rebuild the currently selected table in the Tables Window.  The command is available only when the Tables Window is displayed and no other desktop objects are open.

It is only necessary to rebuild a table file when the Table Window indicates that there is something wrong with the table: either there is no file, or the file is damaged and cannot be read normally.  To rebuild a table, select it in the Tables Window list and select the Rebuild Table File command.  Ad Hoc will ask you to confirm that you want to rebuild the table.

When the rebuilding begins, a process window is displayed on the desktop, showing the progress of the rebuild.  You can cancel the rebuild by clicking Cancel on this window.  When the rebuild is completed, click OK to close the progress window and complete the process.

While a table is being rebuilt, you cannot open other desktop objects or exit Ad Hoc.  You can rebuild several tables at once.

The rebuilding process creates a new temporary file and copies records from the old file into the new file, building the file indexes as the records are added.  If the process completes successfully, the old file is deleted, otherwise the new file is deleted and the old file remains the same.

Note:  If some of the records in the old file could not be written to the new, Ad Hoc will tell you and ask if you want to accept the rebuild anyway.  If you do, the unwritten records will be lost.  Accept a partial rebuild only after trying to rebuild the file at least twice and only if you have no backup of the table.  Use this as a last resort.


Database Maintenance


Empty Table File Command
Empty Table File Command  (Tables Menu)

See Also

Use the Empty Table File command to delete all the records from a table, or to create a new table file if one currently does not exist.  This command is available when the Tables Window is displayed.  It erases the table that is currently selected in the Tables Window list.  Ad Hoc will ask you to confirm the command before it erases the table.

Warning:  This command will erase all the data that was stored in the selected table.  The only way to recover the data is to restore it from a backup.


Edit Database Information Command
Edit Database Information Command  (Tables Menu)

Use the Edit Database Information command to edit attributes of the database.  Currently this is only the long description of the database.  You cannot change the ID of the database that was assigned when the database was created.  This command displays the Edit Database Information dialog.


Run Database Diagnostics
Run Database Diagnostics Command (Tables Menu)

Select the Run Database Diagnostics command when the Tables Window is displayed to run a diagnostics test on the design integrity of the database.  See Diagnostics for details.


Run Table Diagnostics
Run Table Diagnostics Command (Tables Menu)

Select the Run Table Diagnostics command when the Tables Window is displayed to run a diagnostics test on the design integrity of the table that is selected in the Tables Window.  See Diagnostics for details.


Window Menu Command Summary

Tile

Arranges all open desktop objects in a tiled layout.  If you select this command, Windows will move all the desktop objects and change the size of some objects.  Form objects will not change size, but lists, report designs, and the Tables Window will change size to fit the tiling pattern.

Cascade

Arranges all open desktop objects in a cascading layout.  If you select this command, Windows will move all the desktop objects and change the size of lists, report designs, and the Tables Window.  Forms will not change in size.

Arrange Icons

Arranges the icons of all desktop objects that have been minimized.

Close All

Closes all open desktop objects.  If the object design has been edited, Ad Hoc will prompt you to save the design.


Help Menu Command Summary

Contents

Displays the help system table of contents.

Search

Search for help on a topic in the help system index

Context

Display context sensitive help.  The help topic that appears depends upon the desktop object that is currently active.  This menu command gives the same results as pressing the F1 key.

Procedures

Display the Procedures help topic, which lists help topics on how to perform selected procedures in Ad Hoc.

Commands

Displays the menu commands reference in the help system.

Using Help

Displays help on using the help system.

About

Displays a dialog box with information about Ad Hoc.


Report Menu Command Summary

The Report Menu appears on the Ad Hoc menu bar only when a report design window is the currently active desktop object.  This menu contains commands that allow you to design a report and test it.

Elements

Displays a list of elements defined for the report, from which you can add new elements, edit the attributes of an element, or delete elements.

Regions

Displays a list of regions defined for the report, from which you can add new regions, edit the attributes of a region, or delete a region.

Layout

Displays the Report Layout dialog, with which you can define the design attributes of the report.

Edit Startup Dialog

Displays the Startup Dialog associated with the report, and allows you to design it by placing controls on it that are associated with report fields.  This command is available only if you have designated that the report will have a startup dialog on the Report Layout dialog.

Data View

Displays the Edit View dialog, enabling you to design the database view that will be associated with the report.

Report Breaks

Displays the Report Breaks dialog, with which you can define break levels for the report.  A break level happens whenever a new record is read and the value of the field associated with the break level is different from the value in the previous record.

Total Fields

Displays a list of total fields that have been specified for the report, and enables you to add new total fields, change the definition of total fields, or delete total fields from the report.

Computed Fields

Displays a list of computed report fields, and enables you to add new computed fields, change the definition of computed fields, or delete computed fields from the report.

Insert Field

Displays a list of all the report fields that have been defined for the report, and enables you to select a field to be inserted at the current position (the position of the blinking cursor) in the report edit window.

Run Diagnostics

Runs a diagnostics test on the report.

Print

Prints the report being designed in the currently active report design window.

Display

Opens a report display window to display the output of the report being designed.


Elements Command
Elements Command  (Report Menu)

See Also

Use the Elements command to work with the elements that have been defined for a report.  The Elements command displays the Report Elements dialog.  From this dialog you can edit an element design, add new elements, or delete elements.


Designing Reports

Understanding Reports

Designing Report Elements

Designing Report Regions

Designing a Report Startup Dialog


Regions Command
Regions Command  (Report Menu)

See Also

Use the Regions command to work with the regions that have been defined for a report.  The Regions Command displays the  Report Regions dialog.  From this dialog you can edit a region design, add new regions, or delete regions.


Layout Command
Layout Command  (Report Menu)

See Also

Use the Layout command to change the attributes of a report, including its description, page layout, font,  and other general report characteristics.  The Layout command displays the Report Layout dialog.  The Layout command is not only found on the Report Menu, but also on the pop-up menu that is displayed when you click the right mouse button on the ruler in the report design window.


Edit Startup Dialog Command
Edit Startup Dialog Command  (Report Menu)

See Also

Use the Edit Startup Dialog command to design the dialog that is displayed when you print a report.  The startup dialog of a report enables the user to set values that will determine how a report is printed.  This command is available if you have checked the "Startup Dialog" option on the Report Layout dialog.  This command displays the startup dialog in an edit mode, enabling you to design controls on the dialog.  See Designing a Report Startup Dialog.

To hide the startup dialog when you are finished with it, select Hide on its system menu, or just double-click its system menu icon.

When the report is printed, the startup dialog will be displayed as you designed it, with the addition of an "OK" and a "Cancel" button at the bottom.


Data View Command
Data View Command  (Report Menu)

See Also

Use the Data View command on the Report menu to define the database view associated with the report.  This command displays the Edit View dialog.  The report view determines the information that is extracted from the database to appear on the report.  The order of the records in the view determines the order of the report.

The fields of the view become available as database fields on the report.  The fields that the view (and therefore the report) is sorted on are available to use as report breaks.  When you use the Data View command to change the view fields or sort order, you may change any previous definitions of the report breaks.  If you remove a field from the view that has been used in the report, Ad Hoc will not display an error, but when the report is printed, "???" will appear on the report in the positions of any fields that are no longer defined in the view.


Report Breaks Command
Report Breaks Command  (Report Menu)

See Also

Use the Report Breaks command to define the break levels of a report.  This command displays the Report Breaks dialog, which enables you to define the break levels of the report.

You can define break levels only after you have defined the report view using the Data View command.  If you change the fields in the view, or the sort specification of the view, you should select the Report Breaks command to see if the breaks you have defined are still valid.


Total Fields Command
Total Fields Command  (Report Menu)

See Also

Use the Total Fields command to work with the total fields of a report.  This command displays the Total Fields dialog, which enables you to define or delete total fields for the report.  Total fields can be placed on the report layout using the Insert Field command.


Computed Fields Command
Computed Fields Command  (Report Menu)

Use the Computed Fields command to work with the computed fields of a report.  This command displays the Computed Fields dialog, which enables you to define or delete computed fields for the report.  Computed fields can be placed on the report layout using the Insert Field command.


Insert Field Command
Insert Field Command  (Report Menu)

Use the Insert Field command to insert a defined report field into the report layout at a designated location.  This command displays the Report Fields dialog.  This dialog lists the fields that have been defined for the report.  When you select a field from this dialog, it is inserted into the report layout at the cursor position.

The Insert Field command also appears on the pop-up menu that is displayed when you click the right mouse button when the mouse cursor is over the edit region of the report edit window.  You can also insert a field by pressing the INS key.

To insert a field in a report layout

1.	Move the edit cursor on the report layout to the spot you want to insert the field

2.	Select the Insert Field command (or press Ins) to display the Report Fields dialog

3.	Select the desired field from the Report Fields dialog by double-clicking it, or highlighting it and clicking OK or pressing ENTER.

To delete a field in a report layout

If the cursor is to the immediate left of the field, press the DEL key, or

If the cursor is to the immediate right of the key, press the backspace key, or

Select the field and press the DEL key

The types of report fields that can be inserted using the Insert Field command are:

Field Type Description
Standard Fields	Built-in report fields that include Page, Date, and Time.
Database Fields	Database fields are defined in the report view (See Data View Command).  The report field name is an "@" sign followed by the field ID of the field.  (if the field is from a linked table, the link prefix is not used).  If two fields in the view have the same base ID, a "1" is appended to the name of the second field.
Total Fields	Total fields are defined with the Total Fields command.  Total fields appear with the name (ID) you entered when you defined the field.
Computed Fields	Computed fields are defined with the Computed Fields command.  Computed fields appear with the name (ID) you entered when you defined the field.


Print Command
Print Command  (Report Menu)

Use the Print command on the Report menu to test the report you are designing.  This command prints the report as it is currently appears in the report design window.  It is a good practice to save changes you made to the report design before you test it with the Print command.


Form Menu Command Summary

The Form menu contains commands that allow you to retrieve records from the database, control the updating of the record displayed in the form, and perform other run-time operations on the data associated with the form.

The Form menu is not displayed on the Ad Hoc menu bar.  Instead, you display the Form menu by clicking the right mouse button when the cursor is positioned over the free area of a form on the desktop, or by pressing Alt-M when a form is the active desktop object.  The "free area" of the form is any part of the form that is not a form control or a scroll region.  When the form is in design mode, this action will display the Form Design menu.  When the form is not in design mode, this action will display the Form menu.

The Form menu contains the following commands:

Find

Displays the search window for the form, which allows you to browse through the records in the view attached to the form and select a record to be loaded into the form.  This command is available only if the form has been designed with a search window.

Next

Loads the next record from the view into the form.

Previous

Loads the previous record from the view into the form.

First

Loads the first record from the view into the form.

Last

Loads the last record from the view into the form.

New

Blanks out the data displayed on the form and prepares for the entry of a new record into the database.  This command is only available if the form has been designed to add new records.

Update

Updates the displayed record in the database if changes have been made.  This command is available only if the form has been designed to allow changes to data, and you have changed one or more of the fields on the form.

Cancel

Cancels changes to the data on the form, restoring all fields to their original value.

Delete

Deletes the current record displayed on the form.  If you select this command and the confirmation option is turned on, Ad Hoc will ask you if you want to delete the record.  Respond Yes to delete it, No to avoid deleting the record.  This command is available only if the form has been designed to allow deletion of records.

Import

Initiates a data import using the data exchange template attached to the form.  This command is only available if the form has been designed with a data exchange template.

Export

Initiates a data export using the data exchange template attached to the form.  This command is only available if the form has been designed with a data exchange template.

Form Links

Links the active form to another form or list on the desktop.  The active form becomes a master to the linked form or list, controlling the data that is displayed in it.

Run Diagnostics

Runs a diagnostics test on the form design.

Design Mode

Places the form in design mode, allowing you to make changes to the design of the form.  In design mode, you can display records from the database on the form, but you cannot add, edit, or delete records.


Import Command
Import Command (Form Menu)

See Also

Use the Import command to import data from an external file into a Ad Hoc database.  Data is imported through a form for which a data exchange template has been defined.  The Import command displays the Data Import dialog, which enables you to control the import process.


Data Exchange Template Dialog

Importing Data

Exporting Data


Export Command
Export Command  (Form Menu)

See Also

Use the Export command to export data from a Ad Hoc database to an external file.  Data is exported through a form for which a data exchange template has been defined.  The Export command displays the Data Export dialog, which enables you to control the export process.


Design Mode Command
Design Mode Command  (Form Menu and List Menu)

Use the Design Mode command to put a form or list in design mode.  This command appears on the Form menu and on the List menu.

When a form or list is in design mode, you can make changes to its design by using commands on the Form Design menu or List Design menu, respectively.


Form Design Menu Command
Form Design Menu Command Summary

The Form Design menu contains commands that you will use to design the form layout and operation.  With these commands you can change the design attributes and database permissions of the form and add form controls and scroll regions.

The Form Design menu is not accessible from the Ad Hoc menu bar.  Instead, you display it by clicking the right mouse button when the cursor is positioned over the free area of the form, or by pressing Alt-M when a form is the active desktop object.  The "free area" of the form is any part of the form that is not an item such as an edit control or scrolling region.  When the form is in design mode, this action will display the Form Design menu.  When the form is not in design mode, this action will display the Form menu.

The following commands are on the Form Design menu:

Form Attributes

Use this command to display the Form Attributes dialog.  You use this dialog to define the Form ID, the form description, and set custom attributes of the form.

Data View

Use this command to display the Edit View dialog.  You use this dialog to define the fields that are in the view associated with the form, as well as the sort order and selection filter of the view.

Data Exchange Template

Use this command to display the DX Template dialog.  You use this dialog to define the characteristics of the data exchange template attached to the form.  This command is accessible only if you have checked the Data Exchange Template check box on the Form Attributes dialog.

Fonts

Displays the form Fonts dialog, where you can specify the fonts to be used to display control titles and data on the form.

Colors

Displays the form Colors dialog, where you can specify the colors to be used to display the form.

Control Attributes

Displays the attributes dialog for the selected control or controls.  You use this dialog to define the characteristics of a form control, such as the field it is associated with, its title, the position of the title, and its display style.  If more than one control is selected, the attributes dialog for each control will be displayed in sequence.  If no controls are selected, this command is grayed.

New Edit

Enables you to insert a new edit control on the form.  Ad Hoc will display the Edit Control Attributes dialog.  When you accept the entries on the dialog, the mouse cursor will appear as a cross.  Position the cursor at the spot on the form where you wish the upper left corner of the edit control to be located, and press the left mouse button.  The new control will be displayed on the form.

New Combo Box

Enables you to insert a new combo box control on the form.  Ad Hoc will display the Combo Box Attributes dialog.  When you accept the entries on the dialog, the mouse cursor will appear as a cross.  Position the cursor at the spot on the form where you wish the upper left corner of the control to be located, and press the left mouse button.  The new control will be displayed on the form.

Next Text Box

Enables you to insert a new text box control on the form.  Ad Hoc will display the Text Box Attributes dialog.  When you accept the entries on the dialog, the mouse cursor will appear as a cross.  Position the cursor at the spot on the form where you wish the upper left corner of the control to be located, and press the left mouse button.  The new control will be displayed on the form.

New Scroll Region

Enables you to insert a scroll region on the form.  The cursor will change to a cross-hairs.  Position the cursor to the location you desire for the upper left corner of the scroll region, then press the left mouse button and drag the bottom right corner of the region to the desired location.  When you release the mouse button, Ad Hoc will display two dialogs in succession to allow you to define the scroll region before it is displayed:  the List Attributes dialog allows you to define the design attributes of the list attached to the scroll region, and the Edit View dialog allows you to define the database view associated with the list.

When you have entered the design information in these two dialogs, Ad Hoc displays an imbedded list form in the scroll region.

Quick Layout

Enables you to quickly lay out the controls of a new form.  When you select this command, Ad Hoc displays the Quick Form Layout dialog, where you can define the layout of controls on the form.  When you accept the entries on the dialog, Ad Hoc adds the controls you specified to the form.  You can perform a quick layout only on a form that contains no controls.

Delete Control

Deletes the selected control (or controls) from the form.

Alignment

Displays a submenu for arranging the selected controls on the form.  See Aligning Controls on a Form .

Align Left	Grow to Largest Width

Align Top	Shrink to Smallest Width

Align Right	Space Equally Horizontally

Align Bottom	Space Equally Vertically

Set Tab Order

Enables you to set the tabbing order of the controls on the form.  This is the order in which the controls will receive the input focus when you press the Tab key.  When you select this command, the cursor changes to the Tab Order shape.  Move the cursor to the first control in the tabbing order, and press the left mouse button.  The control will be highlighted.  Continue clicking on the controls in the order that you want.  When the last control is highlighted, the cursor will change back to its regular appearance, indicating that all the controls have been ordered.  You can exit the tab order mode at any time by selecting the Set Tab Order command again.  The controls that you order before exiting stay in the new tab order.

Run Diagnostics

Runs a diagnostics test on the form design.

Leave Design Mode

Takes the form out of design mode.  The form then can be used to add, edit, and delete records in the database.


List Menu Command Summary

The List menu contains commands that allow you to perform operations on the data associated with the list.

The List menu is not displayed on the Ad Hoc menu bar.  Instead, you display the List menu by clicking the right mouse button when the cursor is positioned over the list, or by pressing Alt-M when a list is the active desktop object.  When the list is in design mode, this action will display the List Design menu.  When the list is not in design mode, this action will display the List menu.

The List menu may contains the following commands, depending on the permissions you assigned when you designed the list:

Add Record

Enables you to add a record to the database through the pop-up edit form associated with the list.  This command is not available if the list has not been designed to add records to the database.

Edit Record

Enables you to edit the record associated with the highlighted entry in the list.  The editing is done on the pop-up edit form associated with the list.  This command is not available if the list has not been designed to edit records.

Delete Record

Deletes the record associated with the highlighted entry in the list.  When you select this command Ad Hoc will ask you to confirm the deletion if you have the confirmation option set.  This command is not available if the list has not been designed to add records to the database.

Form Links

Links the form to another form or list on the desktop.  The active form becomes a master to the linked form or list, controlling the data that is displayed in it.

Run Diagnostics

Runs a diagnostics test on the list design.

Design Mode

Places the list in design mode, so that you can change the design attributes and database permissions of the list.


List Design Menu Command Summary

The List Design menu contains commands that you will use to design a list.  With these commands you can design the database view associated with the list, define the columns that will be displayed on the list, and design other characteristics of the list.

The List Design menu is not accessible from the Ad Hoc menu bar.  Instead, you display it by clicking the right mouse button when the cursor is positioned over the list object on the desktop, or by pressing Alt-M when a list is the active desktop object.  When the list is in design mode, this action will display the List Design menu.  When the list is not in design mode, this action will display the List menu.

The following commands are on the List Design menu:

Data View

Displays the Edit View dialog.  You use this dialog to define the database view associated with the list, the fields of the database view, its sort order and selection filter.

List Attributes

Displays the List Attributes dialog, which enables you to:

Design the columns displayed in the list

Design the control buttons on the list

Determine if the list will have an associated pop-up edit form

Determine if the list will have a search control

Determine if the list will have an index control

Fonts

Enables you to specify the fonts to be used for the column headings and entries in the list.

Colors

Enables you to specify the colors of the various areas of the list.

Control Style

This command appears only for lists that are embedded in a scroll region on a form.  It enables you to specify the title of the scroll region on the form.

Link to Parent

This command appears only for lists that are embedded in a scroll region on a form.  It enables you to define the form link between the list and the form it is embedded in.

Use this command to display the Edit Link dialog, which you use to define the link between the list and the form you have placed it on.

Run Diagnostics

Runs a diagnostics test on the form design.

Leave Design Mode

Takes the list out of design mode.  The list then can be used to add, edit, and delete records in the database.


Report Display Window Menu Command Summary

You display the Report Display Window menu by clicking the right mouse button when the cursor is over the display area of a report display window.  The following commands are on the menu:

Select Report

Select this command to open the Print Report dialog, from which you can select a report to be displayed in the window.

Restart Report

Select this command to generate the current report again after you have changed display options or changed the design of the report.  While a report is being generated, this command becomes "Stop Report" and selecting it will stop the report generation.

Options

Select this command to display the Report Display Window Options dialog, which enables you to view and change the report display window options.

Go To Page

Select this command to type in the number of the report page that you want to display.

Next Page

Select this command to display the next page of the report.

Previous Page

Select this command to display the previous page of the report.

First Page

Select this command to display the first page of the report.

Last Page

Select this command to display the last page of the report, or, if the report is still being generated, the last generated page.

Run Diagnostics

Runs a diagnostics test on the design of the currently loaded report.


Run Diagnostics Command

This command appears on several menus associated with forms, lists, and reports.  Select this command to runs a diagnostics test on the form, list, or report.  See Diagnostics for details.


Glossary

A

active form

active window

B

break level

break, report

Btrieve

Btrieve file

C

combo box

computed field (report)

control

control pad

D

database

data change notice

data dictionary

data exchange

data exchange template

data types

data view

design mode

desktop

desktop layout

desktop object

E

edit control

element, report

embedded list

event, report

export

extended field ID

extension, filename

F

field

file

file, system

file, table

filename

filter

filter rule

floating region

focus

font

foreign key

form

form control

form links

I

ID

import

index

index segment

input focus

K

keystroke navigation

L

landscape orientation

link

list

M

margins, report

maximize icon

minimize icon

N

null

P

pathname

permission

page break

point

portrait orientation

primary key

primary key index

R

record

record locking

region, report

render

report

report break

report field

required field

root table

ruler

S

scroll bar

scroll region

segment

sort specification

startup dialog, report

status bar

system files

system menu

T

table

table file

table link

text box

title bar

total field

V

view


The active form is the form or list on the desktop that is currently accepting keyboard input.  It is also on top of any other forms displayed on the desktop.  The active form has a highlighted title area as an indicator.  To make a form the active form, you can click on it with the left mouse button, or select it from the Window menu.


The active window is any window whether its a main program window, a desktop object (form, list, etc., a dialog, or other pop-up window that currently has the input focus.  The window with the input focus is the window that receives and responds to keystrokes.  Usually the title bar of the active window is highlighted.


A report break, or break level is a division in a report that occurs when a designated field in the report changes value.  Breaks are defined by the fields that are used to sort a report.  A report break event can be used to print a group heading or total line in a report.


A report field is an item of data that is associated with a report.  It can either appear on the report layout or be used to control the report sort order or record selection.  There are several types of report fields:

Database fields, the fields defined in the report data view, are used to include data from the database in the report

Built-in fields, such as Date and Page Number

Total fields are special fields that are used to accumulate running totals or averages

Computed fields are fields whose values are computed or input by the user when the report is printed.


Btrieve is a record manager from Novell.  Ad Hoc uses Btrieve as the default physical file format for its database tables.


A Btrieve file is a DOS file that can be read or written by Btrieve.  The database system tables and the default file type for Ad Hoc database tables are Btrieve files.


A combo box is a control, or data entry area, on a form or dialog box that gives you the option of entering a value, or selecting a value from a list.  Some combo boxes allow you only to select a value from a list.  If the list is not displayed, an arrow icon is shown on the right of the data area, click on this icon to display the list, then select an entry.


A computed field in a report is a field whose value is computed from other fields, from a constant expression defined when the report was defined, or is input by the user on the startup dialog before the report is printed.


A form control is a object on a form that displays and enables you to edit the contents of a data field.  Control types include edit controls, combo boxes, and text boxes.


A control pad is a set of icons in a window or form that represent actions you can initiate.  To initiate an action, click on the icon.  Clicking on a control pad icon has the same result as selecting a command from a menu.


Database

A database is a collection of data organized in ways that make it possible to enter and retrieve the data in many different ways.  The basic structural unit of a database is a table.  The descriptions of how data is organized in the tables, and how the information in one table relates to information in another table is stored in the data dictionary of the database.  A database also contains formats for data entry forms, browse lists, and reports.


A data change notice (or database change notification) is sent to all open forms and lists, as well as the Tables Window, whenever an operation makes a change in the database, such as adding, deleting, or editing a record.  This allows a form or list displaying data to update its display if it is affected by the change.  You can turn this feature off on the Database Options dialog.


Data Dictionary

A data dictionary is a description of how the data in a database is organized, and where the information is stored on disk.  It describes the tables, fields, and indexes of the database.  It also describes how information in different tables can be linked together.


Data Exchange is the process of importing data into a database or exporting data out of a database.


A data exchange template defines a data import or export process.  It describes the fields that will be imported or exported as well as the type of file the data will be read from or export to.  A data exchange template can be associated with a form, so that you can import or export data through the form.


A data view, or view,  is a collection of fields from one or more tables in a database.  It acts like a table in that it can be sorted and filtered, and you can retrieve records from it (and update records in it).  Ad Hoc forms, lists, and reports are associated with a view.


You can set design mode for a form or list object on the desktop by selecting the Design Mode command on the form or list pop-up menu (press the right mouse button when the mouse cursor is over the form or list).  When an object is in design mode, you can change its design and layout, then save it with the Save command on the File menu.


The desktop is the main area of the Ad Hoc window.  Forms, lists, report edit windows, and other objects appear on the desktop.


A desktop layout is a snapshot of all the forms and lists open on the desktop, including their size and position and any form links between them.  You can save a desktop layout under a specified name so that you can restore it again at a later time.


A desktop object is a window that appears on the Ad Hoc desktop.  Desktop objects that you can display on the desktop include forms, lists, report design windows and report display windows.  The Tables Window is also a desktop object.  Other desktop objects include the process windows that appear when you initiate a process, such as rebuilding a table or importing data.


An edit control is a object on a form that displays the value of a data field.  If the edit control is not set to display only, you can edit the field contents in the edit control.  An edit control on a form is just like the edit controls on dialogs in all Windows programs.


An embedded list is located in a scroll region on a form.  A embedded list is usually linked to its parent form so that it displays records related to the record displayed on the form.


A filename extension is the suffix at then end of a filename, separated from the main part of the filename (the title) by a ".".  Extensions are usually used to designate the type or use of a file.  The extensions used in Ad Hoc are:

.DDF	the data dictionary file of a database

.DD	a database system file

.DBF	a database table file

.FRM	a form or list design (template)

.RPT	a report design (template)


A report event is an action that takes place during the printing of a report.  Examples are the start of the report, the start of a new page, reading of a new record from the report view, etc.  Events can trigger the printing of parts of a report, such as a page header.


Export is the action of sending data from a Ad Hoc database to an external file or database .


An Extended Field ID is used to identify fields in a data view, which may contain fields from several tables.  If a field comes from the view's root table, its extended ID is the same as its ID in the table.  If a field comes from a linked table, its extended ID also contains the IDs of the link (or links) from the root table to the linked table.


A report element is a object that appears on a report.  An element can be a detail line, a report title, a paragraph or several paragraphs, etc.  An element is printed in a specified region (area) of the report when a specified event occurs (such as a new page is started, or a new record is read from the view).


Field

A field is a data item of a particular type, such as text, numbers, dates, etc.   When you define a table in a database, you define a list of the fields that will be contained in the records of the table.  Besides the type of data the field will contains, you can also designate the size of the field (the number of characters a character field will contain, for example), instructions on how data is entered into the field, and (optionally) rules to validate the contents of the field.


The term file in Ad Hoc means a DOS file on your hard disk or a diskette.  A database table is stored as a file.  Therefore, a table not only has an ID, by which it is identified in the data dictionary, but it also has a DOS file name.


A filename is the name used by DOS to identify a file.  It includes the file title, which can be up to eight characters, followed optionally by a period and an extension, which can be up to three characters.  Each database table must be given a file name for it to be stored on the disk.


A filter  determines the selection of records from a table or view when the records are displayed in a form or printed in a report.  A filter is a set of filter rules or selection criteria, such as "ORDERNO equals 334 and DATE greater than 3/4/93".  Only records in the table whose ORDERNO field equals 334 and DATE field is later than 3/4/93 are selected.


A filter rule is a record selection rule.  A set of filter rules make up a filter.  A rule is usually composed of the ID of a field in a record, an comparison operator such as "equals" or "greater than", and a value to which the contents of the field is compared.


a floating region is a report region that doesn't have a fixed vertical position or size, but "floats" or extends between the regions above and below it.


A font is a collection of type faces and styles that you can apply to text in forms, lists, and reports.  When you specify a font, you specify the type face, size, and style (e.g. bold or italic) of the text.  Your font selection is limited to the fonts you have installed in Windows and (for reports) the fonts available for your printer.


A foreign key is a field, or group of fields, in a database table record, that together are equivalent to the primary key of another table.  Foreign keys are used to defined link, or relations between two tables.


A form is a window on the Ad Hoc desktop that is used for entering and editing data in the database.  A form displays one record at a time from the database and appears much like a standard Windows dialog.  You can design forms and store them in the database for later use.


Form Link

A form link used to link a form or list to another form or list on the desktop.  When a form is linked to another form, it becomes a "slave" to the other form, and the records it can display are determined by the record that is currently selected in the other form.


ID

Every object defined in a database requires a unique identifier for the program to be able to locate it and work with it.  When you design a database, you specify an ID for the database, and for each table, field, table link, form, list, and report.  The ID is only 8 characters to save space, so these objects also have a longer Description that serves as a name you can recognize.  No two objects of the same type can have the same ID, except that fields in different tables can have the same ID.


Import is the action of reading data from an external file or database into a Ad Hoc database.


An index is a permanent sort on a database table that is stored with the table.  The data dictionary can contain a number of indexes for a particular table.  As records are added or deleted to a table, the index is updated to remain current.


An index segment is one of the fields that define an index in a table.


The input focus is a term in Windows describing which window on the screen is currently active and receiving input from the keyboard.  On a dialog, or on an Ad Hoc form, the control with the focus is the one that you are currently entering data into.  You move the focus by pressing the TAB or Shift-TAB key, or by clicking on another control.


Keystroke Navigation

Keystroke navigation is the process of selecting an entry in a list by typing characters instead of using the scroll arrows.  Ad Hoc has two options for keystroke navigation: progressive keystroke navigation, the default option. allows you to type a string of characters that is used as a search key for an entry in the list.  As you enter each character, the highlight is moved to a new entry that is the closest match to the entire string.  The second option is a single-key option, typing a character moves the highlight to the next list entry that starts with that character.


Landscape orientation for a printer is when the long dimension of the paper is at the top


Link

There are two types of links in Ad Hoc.

A table link is an association, or relation, of two tables.

A form link is a control link between two forms on the desktop.


A list is a desktop object that can display a number of records from the database at a time in a scrolling row-and-column format  You can design lists and save them in the database for later use.


Report margins are the margins set in the report layout for a printed page.  You set left, right, top and bottom margins for the page layout of a report.


  The maximize icon on a window enables you to re-size the window to its maximum size.


  The minimize icon on a window enables you to re-size the window to an icon.  If you minimize Ad Hoc, it will appear as an icon on the Windows Desktop.  If you minimize a form, list, or other Ad Hoc desktop object, it will appear as an icon on the Ad Hoc desktop.  Double-click an icon to restore the window to its previous size.


A null value for a field is a value that has not yet been defined.  If you do not enter a value for a field when you fill out a form, the value of the field is null, and the field will be blank.  Note that for a numerical field, a null value is not the same as a value of zero.


A pathname is the name of a DOS file prefixed by its location on the disk.  For example, a file with the filename TEST.DBF that is located in a directory called DATA located in the root directory of the C: drive would have the pathname "C:\DATA\TEST.DBF".

When you define a database table in Ad Hoc, there is an entry for the filename and a separate entry for the pathname.  The pathname entry in this case should not include the filename.  For the above example, the pathname would be entered as "C:\DATA".


A database permission allows a form or view access to change a record in the database.  Permissions include:

Add a new record

Change the contents of a record

Delete a record


A page break is the action of starting a new page when a report is printing.


A point is a typographical unit of measure.  There are 72 points in an inch.  A point is used to measure the height of characters in a font or the leading (spacing between lines).


Portrait orientation of a printer is when the short dimension of the paper is at the top of the page.


The primary key of a database table is a field, or group of fields, whose value uniquely identify a record in the table.  Therefore no two records can have the same value for the primary key.  Every table has an index based on the primary key, and the primary key index is always the first index defined for the table.


The primary key index of a table is the first index, or index 0, in the table's index list.  It sorts the table by its primary key.  This index should be defined without the Modifiable, Duplicates Allowed, and Nulls Allowed attributes.


Record

A record is the unit of storage in a table that represents all the information for a particular person or object.  In the row and column representation of a database table, the rows in the table correspond to records.  A record is divided into the fields, or data categories, defined for the table.


When the record locking option is on, and an application locks a record, no other application can access the record until the locking application releases it.  When you make a change to a form, the form locks the record until you update the record.


A report region is a specified area on the page layout of a report, where designated elements of the report are rendered.


A required field is a field that has the required attribute, meaning the that field is not allowed to have a null value.  Each record in a table must contain a value for a required field.  When you are entering a new record through a form, you cannot leave a required field blank.


Rendering is the act of printing an object in a report, or displaying an object on the screen.


A report is designed output format for data that can be printed or displayed on the screen.  A report design is stored in the database and retrieved when a report is printed.


The root table of a view is the primary table upon which the view is based.  The indexes of the root table are also the indexes of the view.  When you read records from the view using an index (instead of sorting the view), the records are in the order of the corresponding records of the root table.  A view must have a root table defined, and the fields of the view will be fields from the root table as well as fields from other tables related to the root table by links defined for the root.


Report Design Ruler

The ruler displayed at the top of the Report Design Window indicates the horizontal position within the margins of the report in inches.  The bottom half of the ruler contains margin and tab indicators.


A scroll bar is a window control that enables you to use the mouse to make the list scroll.


A scroll region is an area on a form that contains an imbedded list object.  You can manipulate a scroll region when the form is in design mode just as you would other form controls.


A segment is a data field that is part of an index, primary key, or foreign key.  For example, the primary key of a table might be composed of two of the fields defined for the table.  Each of those fields is a segment of the primary key.  An index for the table based on the primary key would have the same two segments.  A foreign key for this table in the record of another table would also have the same two segments.


A sort specification is a description of how the records in a data view will be sorted.  It is a list of the fields from the view whose values will be used to sort records.  Each field can be sorted in ascending or descending order.


A report startup dialog is displayed before a report is printed, to enable the user to specify certain values or report controls to be used during the printing of the report.


The status bar is displayed at the bottom of the Ad Hoc main window.  It shows the status of operations and also quick help when selecting commands from menus.


The system files of a database include the data dictionary file, which defines the database and its tables, and other files that store additional information, such as form and report designs.  The names of these files are based on the ID of the database.  For a database with ID MYDB, the system files are:

MYDB.DDF	the data dictionary file

MYDBD.DD	the _DDDATA table file.  Contains data dictionary information such as field validation rules

MYDBF.DD	the _FORMS table file.  Contains forms, lists, and saved desktop layouts

MYDBR.DD	the _REPORTS table.  Contains report designs


The system menu of a window is a standard menu that controls the sizing and display of the window.  The system menu is displayed when you click on the system menu icon (or click on the window icon if the window is minimized).

  The system menu icon is located in the upper left corner of a window.  Double clicking on the system menu icon will close a window.


Table

The data in a database is stored in a basic unit called a table.  The data in a table usually relates to a specific category of objects, such as employees or purchase orders.  You can picture the arrangement of data in a table in a row and column format.  The rows are called records and relate to a specific object, such as an employee.  The columns correspond to the data items, or fields, contained in the table, such as employee ID and name.  You can define indexes for a table, which make it possible to retrieve the records in a particular order.  In Ad Hoc, you can also define relationships to other tables, called links.


A database table file is the physical file on disk associated with a database table.  The name of the file is specified in the table definition on the Database Table Dialog.  The suggested name of a table file is the ID of the table followed by the extension ".DBF".


Table Link

A table link relates information in one table to information in another table.  If a database consists of more than one table, it is usually desirable to retrieve information from more than one table to use in a report or screen display.  Relational databases provide ways for you to "relate" the fields from one table to the fields from another table.  Using the sample employee database that is provided with Ad Hoc as an example, you may want to print an employee report with information from the employee table and also information about the department each employee works in from the department table.  There must be a way to connect each employee record in the EMPLOYEE table with the appropriate department record in the DEPT table.  The link between the two tables is defined as:  the DEPT field (employee's department) in the EMPLOYEE table matches (equals) the DEPTID field (department id) in the DEPT table.


A text box is a form control that is used to display and edit a field of type Text.  The text box contains multiple lines of text that can scroll vertically.


The title bar is the area at the top of a window, including the Ad Hoc main window and the desktop objects, that contains the title of the window.  If the window is active, the title bar will be displayed with the highlighted color.  You can move a window by dragging its title bar.


A total field in a report is a report field that accumulates a running total of the value in a designated target field in the report view as records are printed in the report.  A total field can compute a total, count, average, minimum, or maximum of the target field values.


Printing and Displaying Reports
Printing and Viewing Reports

Up

Set up a printer

Print a report

View a report

View a report in preview mode

Zoom the report view

Set report display options

Print mailing labels

Print envelopes


Set up a printer

Select the Printer Setup command on the File menu

Highlight a printer in the list on the Printer Setup dialog

Click the Setup button to display the setup dialog for your printer

The setup dialog is specific to your printer.  Click the Help button on the dialog for help.

Select OK on the Printer Setup dialog

Note: the printer settings you make in Ad Hoc are local to Ad Hoc and do not affect other programs.  They are discarded when you exit Ad Hoc.


Print a report

If the report requires a special setup, such as changing the paper bin or specifying landscape orientation, set up the printer

Make sure your printer is on-line

Select the Print Report command on the File menu, or press F9

Highlight the report in the displayed list and select OK
or
Double-click the report in the list

If the report has a startup dialog, fill out the dialog and select OK

If the report requires a record sort, a sort progress dialog will be displayed

If you have to stop the report while it's printing, select Cancel on the Printing Report dialog


View a report

Select the Display Report command on the File menu, or press Ctrl-F9, to open a report display window

The report display window will display the report selection dialog

If you want to report page size adjusted to fit the display window, see the help topic on adjusting the page size to fit the display window

Highlight the report in the list and select OK, or double-click the report in the list

As the report is generated, the report window title displays the progress.

You may view any pages that have bee generated

When finished viewing the report, double-click the system menu icon on the report window, or select the Close command on the File menu

To stop the generation of the report

Click the Stop Report [image] icon


Adjust the page size of a viewed report to fit the display window

If a report display window is not currently open

Select the Display Report command on the File menu, or press Ctrl-F9, to open a report display window

Select Cancel on the report selection dialog

Click the right mouse button on the report window, or press Alt-M, to display the report window menu

Select the Options command

On the Report Window Options dialog, select the Fit Window option for Page Height and the Custom magnification option.  A suggested magnification to start with is 70 - 80 %.  You can change it later

Select OK

Size the report window as you want

Select the Restart Report command on the report window menu if a report is already loaded, or select the Select Report command on the report window menu to generate a new report


View a report in preview mode

Select the Display Report command on the File menu, or press Ctrl-F9, to open a report display window

Select Cancel on the report selection dialog

Click the right mouse button on the report window, or press Alt-M, to display the report window menu

Select the Options command

On the Report Window Options dialog, select the As Designed option and the Custom magnification option.  A suggested magnification to start with is 70 - 80 %.  You can change it later

Select OK

Select the Select Report command on the report window menu

Follow the steps under the View Report help topic


Zoom the report view

Click the right mouse button on the report display window, or press Alt-M, to display the report window menu

Select the Options command to display the Report Display Window Options dialog

Select the Custom magnification options and enter the desired percentage

Select OK

or, if custom magnification is already set

Press the + key on the keypad to zoom in (increase the magnification) in 5% increments

Press the - key on the keypad to zoom out (decrease the magnification) in 5% increments

using these keys will not affect the option setting on the Options dialog, and selecting OK on the dialog will restore the original setting


Set report display options

Click the right mouse button on the report display window, or press Alt-M, to display the report window menu

Select the Options command

See Report Display Window Options Dialog for help on the options


Print mailing labels

To print mailing labels, you must design a label report.  See help on Label Reports.


Print envelopes

See help on Printing Envelopes


Report Design How To's
Report Design Procedures

Up

General Procedures

Creating a new report, retrieving and saving report designs

Design Tools

Using tools on the Report Design Window

Putting data into a report

Including data from the database in reports and using a report startup dialog to set values at print time

Page Layout

Column and line spacing, headers, footers, titles and column headings

Controlling how a report prints

Special Formats


General Report Design Procedures

Up

Create a new report

Use the Quick Report feature

Save a report design

Change a report design

Delete a report design

Make a copy of a report design for a similar report


Report Design Tools

Up

Use the report design window

Use report design fastmenus

Test a report design

Preview a report design


Putting Data into a Report

Up

Include data from the database in a report

Specify a sort and filter

Include a startup dialog

Specify report data when the report is printed

Specify filter rules when the report is printed


Page Layout

Up

Specify a name and a title for a report

Set margins and page orientation

Space items in the report layout

Set column positions

Specify element margins and indents

Design a page header

Design a page footer

Put the date, time and page number on a report

Assign elements to report regions

Insert an element on a report

Insert a field into a report

Determine the order of elements in the layout

Put borders on regions

Set fonts and line spacing

Specify the same font for several elements

Set tabs

Specify the same tab settings for several elements

Include column totals

Put text in a report

Format Text fields


Controlling how a report prints

Up

Create report breaks to group records

Set page breaks

Printer selection and configuration


Special Formats

Up

Create a report for mailing labels

Suppress blank lines on labels

Create a report for Envelopes


How to Create a New Report
Create a new report

Select the New command on the File menu.

Select one of the three new report options offered.

Follow the steps in Designing Reports, or see other report design how to's.


Use the Quick Report feature

To create a new report as quickly and easily as possible, See Creating a Report Quickly.


Save a Report Design

The report design window must be the active window.

Use the Save command on the File menu, (its enabled only when the report design has been changed) or

Press the F4 key.


Change a report design

Select the Design Report command on the File menu

Choose the report you want to edit.

Make the design changes in the report design window.

Save the report design.


Delete a report design

Select the Delete Report command on the File menu,

Choose the report you want to delete.


Preview a report design

To preview a report you are designing:

Use the Display command on the Report Menu (on the main menu bar when the report design window is active) or

Use the Display command on the report design window fastmenu

This will "print" the report in a report display window.  To preview the report as it will appear on paper make sure you set the As Designed option on the Report Display Window Options dialog.

Change the magnification option on the options dialog to zoom the view of the report in or out.


Make a copy of a report design for a similar report

Select the Design Report command on the File menu, and choose the report you want to copy

Select the Report Layout command on the Report menu, then on the Report Layout dialog change the ID of the report and the description

Save the report under the new name using the Save command on the File menu or the F4 key

If you want to design a base template for several reports and don't want to save it as a report in the database, save it to an .RPT file with the Save to File command on the File menu.  You can read it in later, change the ID and Description, modify the design, and then save the new report in the database as above.


Include data from the database in a report

You specify the data from the database that will be included on the report by defining the data view of the report.

Use the Data View command on the Report menu (main menu bar when the report window is active) or the report design window fastmenu to open the Edit View dialog.

Specify the primary table for the report as the view's root table and specify any data fields that may be used by the report (either displayed on the report, controlling sort order, etc.)

The fields in the data view are now a part of the report fields list.  To insert a field into the report format, see Insert a field


Specify a sort and filter for a report

Define the sort order and record selection filter for a report in the report's data view.  Use the Data View command on the Report menu to display the Edit View dialog.


Include a startup dialog

Check the Startup Dialog option on the Report Layout dialog

To display the startup dialog once this option is set, select the Edit Startup Dialog command on the Report menu.

To hide the startup dialog, select the Hide command on the dialog's system menu, or double-click the system menu icon in the top left corner

To remove the startup dialog from the report, un-check the Startup Dialog option on the Report Layout dialog


Specify report data when the report is printed

To be able to enter data that will appear in a report just before you print it:

For each item of data that you want to specify, create a computed field

Add a startup dialog to the report.  See Include a startup dialog

Place a control for each of the desired computed fields on the startup dialog.  See Designing a Report Startup Dialog


Specify filter rules when the report is printed

Create a computed field for each filter rule you want to set at print time

On the Edit Computed Field dialog, specify the database field being filtered as the Equivalent Field

Select the Data View command on the Report menu, then click the Filter button on the Edit View dialog to display the Filter Rules dialog.  Select Add to add a new rule.

Specify the database field being filtered and the comparison rule

Select the Field option for the comparison value

Select the appropriate computed field from the comparison field list

Create a startup dialog for the report and place the computed field on it

For the title of startup dialog control, use language meaningful to the person printing the report such as "Print only for Department" or "Print only for dates between "


Specify a name and a title for a report

Specify the report's ID and Description on the Report Layout dialog.  The ID is used as the primary key of the report when its stored in the database.  The Description is used as the name of the report.  It appears on report selection lists.

Specify the title that is printed on the top of each report page by including it as text in the report layout.  See How to design a page header


Set margins and page orientation

Select the Report Layout command on the Report menu

Specify the dimensions of a report page, its orientation (landscape or portrait) and the margins on the Report Layout dialog

Specify Default page orientation if you want the report to be printed with the orientation already set for the printer.  With this option you can change the printer page orientation with the Printer Setup command before the report is printed.

Specify Portrait or Landscape options to override the current printer setting and force the desired orientation


Space items in the report layout

Specify the vertical spacing between elements (such as detail lines) by setting a top or bottom margin, or both, for an element.  See Vertical Spacing of Elements

Specify line spacing within an element, which also affects spacing between elements.  See Spacing Lines of Text in an Element

Specify the horizontal positions of report columns by setting tab stops.  Never use spaces in the text to position columns.

To space elements that repeat in a horizontal direction, such as labels on a label report layout, specify a fixed size, (width and height) for the element.  Set the width of the element equal to the distance between the left edge of one element and the left edge of the next (this is called the pitch)

See Designing Report Elements


Set column positions on a report

Set the locations of columns in a report by using tab stops.  See Setting Report Tabs


Specify report element margins and indents

For help with element margins, see Element Size and Margins

For help with indenting elements in a report, see also Indenting Elements


Design a page header

Use the Regions command on the Report menu to create a new region for the page header.  The header region should be the first region in the regions list

If the next region below the header region is the main area where detail lines will repeat on the report, make sure it is a floating region.

Create an element for the report title.  See Designing Elements. It's trigger should be the Page Header event.

If the report has column headings, create an element for column headings.  It should also be assigned to the header region and to the Page Header event.


Design a page footer

Use the Regions command on the Report menu to create a new region for the page footer.  The footer region should be the last region in the regions list

If the region above the footer region is the main area where detail lines will repeat on the report, make sure it is a floating region.

Create an element for the contents that will appear in the footer.  See Designing Elements. It's trigger should be the Page Footer event.


Put the date, time, and page number on a report

Position the edit cursor at the position in an element edit area where you want the date, time, or page number to appear.

Use the Insert Field command on the Report menu or press the Ins key to select the desired field from the field list


Assign elements to a report region

Define the report region using the Regions command on the Report menu.

Create the element using the Elements command on the Report menu.  All elements in the same region that are triggered by the same event should appear together in the elements list, in the order they are to appear on the report.

On the Edit Element dialog, specify the region the element is assigned to in the Region control.

If you want to quickly insert a new element below an existing element on the report design window, click the edit area of the existing element to place the edit cursor in that element, then press Shift-Ins.  This displays the Edit Element dialog for a new element with a the same description as the existing element.  Edit the description then accept the dialog to insert the new element.


Determine the order of elements in the layout

The position of elements in the report is determined by:

The location of the region containing the element

If there are multiple elements assigned to the region with different triggering events, the order in which the events happen after a new page is started determines the order of the elements

If there are multiple elements with the same event, the order the elements appear in the elements list (and the order they are shown in the report design window) determines their order in the report layout.


Put borders on regions

Use the Regions on the Report Menu to select a region to edit.

On the Edit Report Region dialog, select the desired combination of left, right, top, or bottom options

Select the border line style.


Set fonts and line spacing

Use the Elements command on the report menu to select an element to edit
or

Click the right mouse button in an element edit area to display the element fastmenu and select the Edit Element command

Click the Fonts button on the Edit Element dialog to display the Font dialog, then select the font for the element

Line spacing is determined by the size of the font.  To override this automatic line spacing, check the Set to option for line spacing on the Edit Element dialog and specify the line spacing for the element in points.


Specify the same font for several elements

Select the Report Layout command on the Report menu

On the Report Layout dialog, enter the font typeface and size, or click the Font button to specify a font in more detail.

For each element that will have this font, check the Use default report font option on the Edit Element dialog.


Specify the same tab settings for several elements

You can specify a common set of tabs for a report that several elements can share.

If the common report tabs have not been defined, select one of the elements that will have the common tab settings by clicking on its edit area in the report design window.

Click the right mouse button in this edit area and select Edit Element from the element fastmenu.

Check the Use common report tabs option on the Edit Element dialog.

Set the tabs on the ruler.  See Setting Report Tabs.

Check the Use common report tabs for all other elements that will share the common tab settings.


Set tabs

See Setting Tabs

For help on setting common report tabs for several elements, see the HowTo on setting the same tabs for several elements.


Insert an element on a report

Use the Elements command on the Reports Menu to display the Report Elements dialog

Select the Add command to add the element to the end of the list, or the Insert command to insert the element at a specified position.

or

To insert a new element below and existing element, click the right mouse button on an element edit area of the existing element

Select the Insert Element command on the element fastmenu

or

Position the edit cursor in the area of the existing element and press Shift-Ins.

Fill out the Edit Element dialog, the accept the dialog.  An edit area for the element will appear on the report design window.


Insert a field on a report

A database field must be defined in the report view before it can be included on the report

Position the edit cursor in the element edit area where you want to insert the field

Select the Insert Field command on the Report menu or press the Ins key

Select the field from the field list and press Enter;


Include column totals

Create a new element for a total line

Assign an event to the element

for report totals, assign the Report Footer event (not Page Footer)

for subtotals for record groups, define a break level, and assign the Break Footer event associated with this break level

Assign the element to the same region that the detail lines are in.  You can create extra space above or below it by giving it top and/or bottom margins.

Create a total field for each column in the report for which you want a total, count, or average.

Insert the total field at the appropriate location in the element


Put text in a report

To include text that is part of the report design, such as the report title, column headings, etc. by positioning the edit cursor at the appropriate spot in an edit element area and typing the text.

To include text that is determined at the time the report is printed, create a computed field and insert it at the appropriate spot in an element.  Then include the field on the startup dialog.


Format Text fields

When you include fields of type Text on a report, follow these guidelines:

To have the most control over the format, don't put text fields on the same line in an element with other fields.  Put each Text field on a different line, or better yet, give each text field its own element so you can specify a set of tabs just for that field.

Specify the Word Wrap option for an element containing a Text field (See Edit Element  dialog).

If the contents of the Text field contains tab characters, set the element tabs accordingly.

To indent a Text field, specify a left margin for the element.


Printer selection and configuration

Use the Printer Setup command on the File menu to select and configure a printer.

To override the page orientation setting of the printer when a report is printed, specify either the Landscape or Portrait option on the Report Layout dialog when you design the report.


Create report breaks to group records

See Report Breaks .


Set page breaks

Automatic page breaks occur when a region is filled up and its time to print the next element in that region.

You can force a page break either before or after an element is printed. See Specifying Page Breaks.


Create a report for mailing labels

To create a new report for printing labels, see Label Reports.


Suppress blank lines on labels

To keep blank lines from printing on labels, check the Don't print blank lines option on the Edit Element dialog for the label element.  This option works for any element on any type of report.


Create a report for envelopes

See Printing Envelopes


Use the Report Design Window

See Report Design Window

See Designing Reports


Use report design fastmenus

A fastmenu is a menu that pops up when you click the right mouse button over certain areas.  The menu contains commands associated with the object or area you clicked.

There are several fastmenus for the report design window:

Click on an element edit area to display the element edit menu for that element

Click on a tab on the ruler to display the tab menu, which enables you to set the tab alignment type

Click anywhere else on the ruler or on the report window client area not covered by an element to display the report design fastmenu, which has most of the commands on the main Report menu on the main menu bar


Test a report design

Select the Display  command on the Report menu to preview the report in a report display window

Select the Run Diagnostics  command on the Report menu to run a diagnostic test on the design of the report


Databases

Introduction to Databases

Tables Window

Creating a New Database

Designing a Database

Database Maintenance

Database Diagnostics


Creating a Database
Creating a New Database

See Also	Procedures

Before you create a database, decide how you want to organize your data into tables.  See Introduction to Databases if you are unfamiliar with database concepts.

Decide on a subdirectory in which to locate the files of the new database.  The system files of the database must all be in the same disk directory, and two databases cannot be in the same directory.  The table files can be located in other directories, but it is recommended that they be in the same directory as the system files.

Create a new database - procedure overview

1.	Select the Create New Database command on the Tables menu if a database is currently open.  If no database is currently open, this command is on the File menu.

2.	If a database is currently open, Ad Hoc will ask if you want to close it.  Respond Yes.

3.	Describe the new database on the New Database dialog, then choose OK.  Ad Hoc will create the database system files for the new database and then open the database, with the Tables Window displayed.  If the Tables Window is not visible, use the Show Tables Window command on the Tables menu to display it.

4.	Add table definitions to the database using the New Table  command on the Tables menu to display the Database Table dialog.  Use this dialog to define the table, including its fields, indexes, and links to other tables.

5.	Design data entry forms and lists and save them in the Forms table.  See Designing Forms and Designing Lists.

6.	Design reports and save them in the Reports table.  See Designing Reports.

Database ID and System Files

A database must have an identifier, the database ID, that is from one to seven characters long.  The ID can be letters or digits.  This ID is used to construct the names of the system files of the database.  Each database that you create must have its own directory for the system files.  Files for other tables you define can be an any directory, and two databases can even share a database table.


Introduction to Databases

Designing a Database

Adding Tables

Designing Tables

Editing Table Definition Command

Designing Forms

Designing Lists

Designing Reports


Designing a Database

See Also

The Create New Database command initializes a new, empty database.  You next have to design its data structure by defining and adding tables to the database. When a table is defined, Ad Hoc creates a table file on your disk to hold the data in the table.

Tables are defined and added to the database on the Tables Window.  When the tables window is open on the desktop, you can use the following commands on the Tables menu to add and define tables:

Select	To

New Table command	Add a new table to the database

Edit Table command	Change the definition of a table
Add or change fields in the table,
Define indexes for the table,
Define links to other tables

Delete Table command	Remove a table from the database


Creating a Database

Designing Tables

Editing Table Definitions

Designing Forms

Designing Lists

Designing Reports


Changing a Database
Changing a Database Design

See Also

You can modify the design of the database at any time by:

Adding or removing tables in the database

Changing the design of a table

Redefining the relations, or links between tables

You cannot change the ID of an existing database.  You can however, change the directory name the database is located in, or move the database to another directory, with the following restrictions:

Only one database (set of database system files) can exist in a directory.

All the system files of a database must be in the same directory.

Note:  You cannot edit a table definition or rebuild a table file from the Tables Window if there are other desktop objects (forms, lists, report design windows) open on the desktop.  This is to guard against possible data integrity errors if you change the structure of a database table that a desktop object is designed around.


Creating a New Database

Edit Table Definition Command,

 Designing a New Table


Deleting a Database

Ad Hoc does not have a command for deleting an entire database.  To remove a database from your disk, use the Windows File Manager or a DOS command to delete all the files. in the database subdirectory, including the system files and the files corresponding to your database tables.

To delete a database table (including its definition in the data dictionary and optionally the physical file that corresponds to it), use the Delete Table command.


Designing a New Table

See Also	Procedures

This topic provides an overview of the process of designing a new database table.  For detailed help with creating and editing a table definition, see the topics under See Also and the Procedures guidelines.

Table Design Overview

1.	Decide on an ID and a Description for the table.  No two tables in the database can have the same ID.  Try to make it descriptive, but since you only have 8 characters, use the Description as the an easily identifiable name for the table.

2.	Enter the general description of the table on the Database Table dialog.  It is strongly suggested that you use the default file name provided by Ad Hoc when you enter the File Name, and that you leave the Path entry blank, so that the table file is created in the same subdirectory as the system files.

3.	Decide on the data items, or fields, that will be contained in each record of the table.

4.	Decide which field will be the primary key for the table.  The primary key should be a field that has a unique value in each record, so that it can be used to identify the record.  This is particularly important if the table is linked to other tables as a lookup table.  In unusual circumstances, the primary key for a table could be made up of two or more fields, but it is recommended that only one field be used.

The primary key field must be marked as "required".  Each record must contain a value for this field.  The primary key field must also be a data type that can be used in an index.  Data types allowable for primary key fields are Character, Long Integer, Short Integer, Numeric, and Date.  Text fields cannot be used for an index.

5.	Add fields to the table definition.  Selecting the Add button on the Database Table dialog displays the Define Field dialog, which enables you to define a new field.

6.	Define the indexes for the table next.  Click the Index button on the Database Table dialog to display the list of indexes for the table.  Select the Add button to display the Define Index dialog, which enables you to define an index.

You must define at least one index.  Indexes are numbered starting with 0, and the first index in the list, index  0, is the primary key index.  Enter the field (or fields) that you are using for the primary key into the list of segments for this index.   Don't check the Modifiable, Duplicates Allowed, or Nulls Allowed options for this index, because a primary key should be a unique identifier for each record that doesn't change once the record added to the table.  If there is an unusual reason for making the primary key index modifiable or duplicates allowed, Ad Hoc will let you get away with a warning, but this could cause problems if you are defining links between tables, because the primary key is used to define the link and also to validate the values of the related fields in the other tables.

7.	Add additional indexes to the table as required for the most common sort orders you will be using for forms, lists, and reports.  Usually this will be two or three indexes.   A database table can have up to eight indexes, and an index can have up to eight segments, however, the total number of segments in all indexes of a table cannot exceed 24.  The total size of the segments in single index cannot exceed 255 bytes.

8.	Add the definitions for links to other tables if desired.  Select the Links button on the Database Table Dialog to display the list of links for the table.  Select Add to display the Define Link dialog, which enables you do define a table link.

9.	When you select OK on the Database Table dialog, Ad Hoc will validate your table design and add it to the data dictionary It will also create a new DOS file for the table.

10.	Run Diagnostics on the table to check your design.

You can change the fields, indexes, and links in a table at any time.  If you change field or index definitions for a table that contains data, Ad Hoc will rebuild the table file to match the new table definition.


Adding a Table

Editing a Table Definition

Database Table Dialog

Define Field Dialog

Define Index Dialog

Define Link Dialog

Primary Keys and Indexes

Table Links


Database Maintenance

Ad Hoc system files database files actually require no maintenance unless they become damaged by a power failure, a disk failure, or some other system disaster.

Back up Your Files

You should make a backup copy of the files on your hard disk on a regular basis.  If your database files are deleted or irreparably damaged, the only way to recover your data is to restore the affected files from a backup copy.  Ad Hoc does not provide a backup command, so you must use a commercial backup program or the DOS backup program.  If you have a large disk filled with data, we highly recommend a tape backup system.  The safest backup policy is to back up files that change regularly every day, and rotate several sets of backup disks or tapes.

Missing Database Table Files

If the Tables Window shows a status of No File for a table,

1.	Check the file name and path name specified for the table on the Database Table dialog (next two steps).

2.	Highlight the table in the Tables Window list

3.	Select the Edit Table Definition command on the Tables menu

4.	Use the Windows File Manager to check that the file specified is in the database directory or, if a different path is specified on the Table Definition Dialog, in the directory specified by the path

5.	If the file is not on your disk, restore it from a backup.

6.	If restoring from a backup fails, your only recourse is to make sure the table with the missing file is highlighted, then select the Empty Table command on the Tables menu to create a new, empty file for the table.

Damaged Database Table Files

If the Tables Window shows a status of Error in file for a table,

1.	Save any changes you have made to form or report designs, and exit Ad Hoc.

2.	Start Ad Hoc again, and display the Tables Window with the Show Tables Window command on the Tables menu.

3.	If the table file is still shown as having an error, attempt to rebuild the file.  Highlight the damaged table in the Tables Window list.

4.	Select the Rebuild Table File command on the Tables menu, and tell Ad Hoc Yes, you want to rebuild the table file.

5.	After the rebuild process is completed, click the OK button on the progress display window.

6.	If the table is still indicated as damaged, you will have to restore it from your latest backup.

Note:  If a number of tables (or all of them) in the Tables Window list are shown with file errors, there may be a system error in your hardware, DOS, Windows, or the Ad Hoc record manager.  In this case, before rebuilding or restoring from a backup, close all your applications, quit Windows, reboot your system, and then reopen Ad Hoc.

Using the Rebuild command to shrink a database file

As records are added to a Ad Hoc table, the size of the table file expands.  As records are deleted, the file size remains the same, but the space for the deleted records is kept track of.  As new records are again added, the space of the old deleted records is used first before expanding the file.

If you have a database file with a lot of addition and deletion activity, and a large number of records have just been deleted, you can shrink the size of the file if you want (its not necessary unless you need the disk space), by rebuilding the table file with the Rebuild Table File command on the Tables menu.

Note:  You cannot edit a table definition or rebuild a table file from the Tables Window if there are other desktop objects (forms, lists, report design windows) open on the desktop.  This is to guard against possible data integrity errors if you change the structure of a database table that a desktop object is designed around.


Diagnostics

Ad Hoc contains several diagnostics routines that you can run to check

the design of a form or list

the design of a report

the database table definitions stored in the data dictionary

The diagnostics report is displayed in the Diagnostics Window

The diagnostics checks are automatically run every time you open a form, list, or report window on the desktop, or print a report.  The database diagnostics are run every time you start Ad Hoc or open a new database.  When these automatic checks are run, Ad Hoc will display the results only if the severity of any errors encountered exceeds a threshold set on the Diagnostics Options dialog.

If fatal errors are encountered for a report, you can't print the report until the errors are corrected (See Designing Reports).  If less severe errors are found, you have the option of continuing or canceling the report.

You can run the diagnostics routines at any other time by selecting the Run Diagnostics command on the appropriate menu

To Check 	Use

A Form	Run Diagnostics command on the Form Run menu or the Form Design menu

A List	Run Diagnostics command on the List Run menu or the List Design menu

A Report	Run Diagnostics command on the Report menu when a report design window is active, or the pop-up menu of a report display window

A Table Definition	Run Table Diagnostics command on the Tables menu when the Tables Window is active

All Tables	Run Database Diagnostics command on the Tables menu


Diagnostics Window

The results of diagnostics tests are displayed in a pop-up window that contains a description of what was tested, and a scrolling list of messages for each warning or error found.  At the end of the report is a summary of the number of errors found.  Select OK to close this window.

When errors are found before printing a report, the diagnostics window contains an OK and Cancel button.  Choose OK to continue the report, or Cancel to cancel it.

Error Levels

There are four levels of errors reported.

Level	Description

Comment	An unusual design that is probably OK, but might be the cause of a minor problem in a form or report

Warning	A situation that will cause unexpected results.  Nothing major, but should be corrected

Error	A problem that will cause unexpected results in a form or report output.  A problem in a table definition that will cause problems elsewhere and should definitely be corrected

Fatal	A serious problem in the design of a form or report (or a table definition) that keep the form or report from working

Diagnostic Checks

The current version of Ad Hoc checks only for major design oversights, or incompatibility between the database and a form or report design.  There are problems that could exist that aren't caught by the diagnostics routines.  These will usually be apparent when you display a form or print a report.

Form Diagnostics

List Diagnostics

Report Diagnostics

Database Diagnostics


Form Diagnostics

The following form design errors are checked:

Invalid root table ID in the view definition

Invalid field IDs in the view definition

No fields defined

Invalid field IDs in the sort specification

Invalid field IDs in the filter definition

No input controls on the form

Controls assigned to invalid fields

Controls assigned to fields of the wrong data type

Controls with an invalid size or position on the form

Search window has a different sort specified than the main form

An imbedded list not linked to the main form (comment only)


List Diagnostics

The following list design errors are checked:

Invalid root table ID in the view definition

Invalid field IDs in the view definition

No fields defined

Invalid field IDs in the sort specification

Invalid field IDs in the filter definition

Invalid fields assigned to display columns


Report Diagnostics

The following report design errors are checked:

Invalid root table ID in the view definition

Invalid field IDs in the view definition

No fields defined

Invalid field IDs in the sort specification

Invalid field IDs in the filter definition

Invalid fields defined for report breaks

Invalid fields inserted into the report layout

Invalid target field for a total field

Invalid clear event for a total field

Element assigned to an invalid event

No regions defined

No report elements defined

Region contains no elements

Region is designated as "size to elements", but contains no elements of fixed size

Two floating regions together, or between non-fixed regions

Element assigned to an invalid region


Database Diagnostics

Diagnostics checks are performed on the table definitions in the data dictionary.  The following errors are checked:

No file name specified for the table

The specified file could not be found

Invalid pathname specified for the table file

Specified file was found, but could not be opened.

No fields defined for a table

No indexes defined for a table

Primary key index (0) defines a modifiable, duplicates allowed, or nulls allowed

Primary key index field not defined as required (no nulls allowed)

Invalid field defined for an index

Field of wrong data type defined for an index

Invalid table ID in a link definition

Invalid fields in a link definition

Fields specified in a link don't match primary key of associated table


Introduction to Databases

What is a Database?

Primary Keys and Indexes

Table Links

Types of Data

Data Views

Forms

Reports

Creating a Database

Database Maintenance

Diagnostics


What is a Database?

See Also

Ad Hoc, like most database management systems, organizes your data in a database.  An Ad Hoc database contains data, information describing how the data is related and can be retrieved in meaningful ways, data entry forms and browse lists for entering and editing data, and report formats which are used to display or print reports.

Tables

The data in a database is structured in units called tables.  Each table contains information related items of information, usually associated with a person or thing.  For example, in the sample database that came with Ad Hoc, the EMPLOYEE table contains information about employees and the DEPT (Department) table contains information about the departments in the company.

A table can be pictured graphically as organized in a row and column format:**

The columns of the table are the categories of data contained in the table.  These are called fields.  The rows of the graphic represent the records in the table.  A record contains the information for a particular object.  The EMPLOYEE table contains a record for each employee.

Indexes

A table can have a number of indexes that make it possible to retrieve records from the table in a particular order.  An index is defined by the fields used to sort the records.  Each field is a segment of the index.  For example, an index used to sort employee records alphabetically contains two segments, employee last name and employee first name.

See Primary Keys and Indexes.

Table Links

Links are part of the description of a database table in Ad Hoc.  A  link defines the relationship between a field (or fields) in the table with a field (or fields) in another table. When you design a table, you can define all the possible links to other tables in the database.  Links are used for a number of purposes.  If a field in a table has a link to another table, then the other table becomes a lookup table for that field.  When you enter data into the field, Ad Hoc automatically validates the entry against the linked table.  The link also makes it possible for data entry forms to provide a pop-up lookup window for that field, from which you can select a value.  A very important use of links is to help you easily construct multi-table views of the data.

See Table Links.

Views

Views provide a customized view of data in the database for use in a particular form, browse list, or report.  A view is like a table in many respects, in that it contains records made up of fields, has a sort order for the records, and can have a filter to select specific records from the database.  The records of the view are not stored physically, but are constructed from the records of the tables contained in the view.  When you describe the fields from the database that are displayed on a form or printed in a report, you are defining the data view for the form or report.

See Views for a more detailed description.


Creating a Database

Designing a Database

Designing a Database Table


Primary Keys and Indexes

See Also

In Ad Hoc, at least one field in each table must be designated as the primary key.  The primary key of a table provides a unique identifier for each record in the table.  No two records can have the same value in the primary key field(s).  Usually, the primary key is a single field, but can be defined as several fields.  As an example, an employee record would contain the employee ID.  Since each employee must have a unique ID, the employee ID is a good choice for the primary key of the employee table.

When you define a database table, you can define one or more indexes for the table.  An index defines a particular sort order for the records in a table, and provides a way to quickly retrieve a record without having to search through all the records in the table one by one.  Indexes are defined by a list of the fields in the table record that determine the sort order of the index.  The fields you select to define an index are called index segments, and an index can have one or more segments.  For example, an index that would order the records by first and last name would have two segments: the "last name" field and the "first name" field.

The first index that you define for a table (index number 0) is always considered as the primary key, and is required for each table.  You can define additional indexes for a table so that you can retrieve records in other sort orders more suited for a particular application.  For example, you may want to define an index for the employee table that consists of the employee's last name and first name, so that you can retrieve records alphabetically.

You can define any sort order for a form or a report, independent of the indexes of the tables that are related to the report.  The difference between a form or report sort and an index is that an index is maintained by Ad Hoc as you add and delete records from a table. As a result, an index is always instantly available to order records in a table.  If you define a sort for a report that matches one of the indexes of the table being used for the report, Ad Hoc will automatically use the table index.  If you define a report sort that does not match  an index, the records are sorted each time you print the report.


Designing a Database Table

Define Index Dialog

Define Link Dialog


Table Links

See Also

Ad Hoc is different from many relational database managers in that it stores the ways the various tables in the database can be related to each other.  In Ad Hoc, the relation of one table to another is called a link.  Links between tables always involve the primary key of one table, and an equivalent field (or set of fields in the other table).  If you are designing a report based on one table (lets call it the main table), but want to include fields from another table (lets call it the related table), the definition of the main table in the data dictionary must include a link to the related table.

The link defines how to match a record in the related table to each record read from the main table.  Identification of the records in the related table is done using the primary key.  So to define a link to the related table from the main table, you must include a field (or fields) in the maintainable that match the primary key field (or fields) of the related table.  The field (or fields) in the main  table are called a foreign key because they can be used to match the primary key of another table.  Each foreign key field must match the other table's corresponding primary key field in data type and size.

As an example, in the sample database, there is a table for employee information and a table for department information.  You want to design a report containing employee information and some information about the department that each employee works in, sorted by employee.  Instead of keeping all the department information duplicated in each employee record, which would waste space and make it very difficult to keep the department information updated, you keep the department information in the department table, one record per department.  The primary key of the department table is the department id, which is different for each record in the table.

One field in the employee record is the department id of the department the employee works in.  This field in the employee record is a foreign key to the department table, and can be used to link a particular employee record to a department record.  You would define this link for the employee table, and when selecting employee fields for a report, you can use this link to also select fields from the department record.  For each employee record printed in the report, Ad Hoc automatically retrieves the appropriate department record.

A database table can have any number of foreign keys to other tables, and therefore any number of links to other tables.  These links define the relations between tables that give a relational database its name.


Designing a Database Table

Define Link Dialog


Data Views

See Also

A very important concept in Ad Hoc is that of the data view.  A view is similar to a table in that it contains records that in turn contain fields.  However a view is not physically stored anywhere, as all of its records are assembled from fields from one or more tables in the database.  Think of a view as a temporary table that is built using information from other tables for the purposes of printing a report or displaying data on the screen.

In Ad Hoc, a view is based on a primary table, called the root table.  The indexes of the root table are also indexes of the view, and the fields of the root table can be selected to be fields of the view.  In addition to the root table fields, however, the view record can also contain fields from any other table for which the root table has a link defined.  You can also select fields from any table that is linked to any of these tables.

The records of a view can be sorted for a form or report using any field in the view, regardless of the table the field is associated with.  Only the indexes of the root table can be used as indexes of the view.

You can also define a filter for a view.  A filter is a set of rules that define a subset of all the records in a view.  (For example, a filter can be define for an employee report to select only employees in the accounting department.).

There are two limitations on views in the current version of Ad Hoc:

Only the fields from the root table can be changed when you enter or update records.  So when you design a data entry form for information in a table, that table must be the root table of the form's view.

Only the fields from the root table can be used to define a filter for a view.


Defining Data Views

Edit View Dialog

Extended Field ID


Forms

See Also

Once you have defined the structure of your database, you need a mechanism for entering data, and viewing it on the screen.  The object that you use for these purposes is the form.  A form appears as a window within the Ad Hoc main program window.  Ad Hoc allows you to design and store any number of forms in the database.

There are two types of forms.  Data entry forms, or (referred to as just "forms" in Ad Hoc), display the fields values from one record at a time and allow you to edit the content of the fields.  A form is similar in layout to a paper form that has blanks to fill in.  List forms display the data in a row and column format, allowing you to see many records at a time and easily browse through a table.  These two types of forms can be combined in several ways to give you powerful data entry and display tools.

When you design a form, you design a view associated with the form.  You can place the fields of the view on the form, define form colors and fonts, define the sort order of view records, define the filter that will select records that will be displayed, and designate other characteristics that tailor the form for a particular purpose.


Using Forms

Using Lists

Designing Forms

Designing Lists


Reports

See Also

Ad Hoc has a very flexible report designer that allows you to design and store many types of report formats, including "row and column" reports, form letters, envelopes, and mailing labels.  Reports, like forms, are associated with a database view that can contain fields from one or more tables in the database.  You can designate a sort order and selection filter for the report and design the layout of information on the report, including margins, tabs, placement of data and text, repeating regions, fonts, line spacing, report breaks, and other layout characteristics.


Printing Reports

Designing Reports


Procedures for Forms

Up

General Procedures

Opening and closing forms

Using Forms to Edit Data

Adding, changing, deleting records

Other Procedures

Saving desktop layouts, Linking forms on the desktop

Procedures for Designing Forms


General Form Procedures

Up

Open a form

Close a form

Close all objects on the desktop

Remove a form from the database

Save a form design to an external file

Read a form design from an external file


Using Forms to Edit Data

Up

Scroll through records on a form

Find a record

Change the sort order of a form

Move the edit cursor to a control

Move the focus to a scroll region

Look up values for a field

Edit a record

Canceling changes to a record

Add a new record to the database

Delete a record

Edit a record displayed in a scroll region

Start a new line in a text box control

Insert a tab in a text box control


Other Form Procedures

Up

Link a form to another

Unlink a form from another


Open a form or list

Select the Open command on the File menu to display the Open dialog

Make sure the Forms (or Lists) option is checked on the Open dialog

Select the form or list you want to open by highlighting it in the list, then pressing Enter
or
Double click the entry


Close a form or list

Make sure the form or list you want to close is the active form

Select the Close on the File menu
or
Select the Close command on the form's (list's) system menu
or
Double-click the form's (list's) system menu icon


Close all objects on the desktop

Select the Close All command on the Window menu.


Remove a form or list from the database

Select the Delete from the File menu.

Select the form (list) you want to delete

Confirm the deletion


Save a form or list design to an external file

Select the Save to File from the File menu.

If this command is grayed out, put the form (list) in design mode and then leave design mode

Specify the file name and location on the File Save As dialog.  The file will have a .FRM suffix

Saving a form (list) design to a file this way is not considered saving the form (list) in the database.  A form or list is not considered "saved" by Ad Hoc until you use the Save command on the File menu.


Read a form or list design from an external file

Select the Read From File command on the File menu

Use the Open File dialog to select the .FRM file you want to read

Only valid .FRM files written from the current database can be read in this way


Scroll through the records on a form

Click a control pad icon or press a key combination or select a command from the Form menu to display records in the sort order of the form:

Icon	Keystroke	Menu command

First record 	 	Ctrl-F	First

Previous record	 	Ctrl-P	Previous

Next record	 	Ctrl-N	Next

Last record	 	Ctrl-L	Last

Hold the mouse button down on the Previous and Next icons for auto repeat.


Find a record

If the form has a search window:

Click the Search Icon [image]  or press Alt-S or select the Search command on the Form menu.

Enter a search key in the search window search control (See Using a Form Search Window) or scroll up and down the list to highlight the selected record.

Click the OK button to select the record


Change the sort order of a form

If the form has a search window:

Click the Search Icon [image] or press Alt-S to open the search window

Select the desired sort order in the Sort control of the search window

Press Esc to close the search window

If the form has no search window or the desired sort order is not in the sort control list, you must specify the sort order on the form's view in design mode. See Defining Data Views.

If there is a sort order that you will use frequently for a form, add an index for it to the root table of the view.


Move the edit cursor to a control

Use the Tab key to move the focus (indicated by the flashing edit cursor) to the next control in tab order

Use Shift-Tab to move in reverse order

or

 Click the left mouse button on the control

Note:

You cannot set the focus on a control that is read-only

You cannot remove the focus from a control that has an invalid value.  Correct the entry, or cancel the update.


Move the focus to a scroll region

You cannot tab into a scroll region.  Instead,

Press the F6 key to move the focus from the main form to a scroll region
Press F6 again to move to the next region or back to the main form

or

Click the left mouse button inside the scroll region.

When the scroll region has the focus, you can use the arrow keys or keystroke navigation to move the selection highlight.


Look up values for a field

For fields that have validation rules defined, or fields for which a link is defined to another table, you can open a lookup window to select a value.

Move the focus to the control for the field, the Lookup icon [image] will appear on the form's control pad

Click the lookup icon with the left mouse button
or
Click the right mouse button on the control
or
Press Alt-<up arrow>

Select the desired value from the lookup list and press Enter or double-click the entry


Edit a record on a form

Use the search window or the Next and Prior commands to display the record on the form

Tab to the control that you want to change, or click it with the mouse

Change the field by selecting text you want to replace and deleting by typing a new entry or pressing the Del key.  New text that you type is inserted at the edit cursor.

When you make the first change to the record, it goes into update mode.  The Update [image] and Cancel [image] icons appear on the control pad.  If record locking is enable, the record is locked.

Make changes to other fields as desired

Accept the changes by clicking the Update icon or pressing the Enter key.

Cancel the changes and restore the original record by clicking the Cancel icon or pressing the Esc key.


Cancel changes to a record

Cancel changes you have made to a record by clicking the Cancel [image] icon, or pressing the Esc key.  Once you have updated the changes to a record by clicking the Update icon or pressing Enter, you cannot cancel the changes.  You have to re-edit the record.


Add a new record to the database

Click the New Record [image] icon
or
press the Ins key
or
Select the New command on the Form menu

The form is blanked out, and the controls for the non-modifiable fields are enabled in preparation for the new record

Fill out the form and click the Update icon or press Enter

To cancel the new record, click the Cancel icon or press Esc


Delete a record on a form

Display the record on the form using the search window or the Next and Prior commands

Click the Delete Record [image] icon
or
Press Ctrl-D
or
Select the Delete command on the Form menu

If the delete record confirmation option is on, Ad Hoc will ask you to confirm the deletion


Edit a record displayed in a scroll region

If a form has a scroll region (which contains an embedded list) and the list is designed to edit records:

Press F6 or click on the list to move the focus to it

Scroll the list to highlight the record to edit

Press the list Edit button or double-click the entry

Edit the record on the pop-up form

Press Enter to accept the changes or Esc to cancel them

See Using Lists for details.


Start a new line in a text box control

Position the caret (edit cursor) at the location in the text box where you want to start a new line

Hold the Ctrl key and press the Enter key


Insert a tab in a text box control

Position the caret (edit cursor) at the location in the text box where you want to insert a tab

Hold the Ctrl key and press the Tab key

Tab stops in a text box on a form are fixed.  On a report layout, the tabs in a Text field will align with the tabstops you set on the ruler.


Link a form or list to another

Activate the master form (list), the form (list) that will control the link

Select the Form Links command on either the File menu or the Form (List) menu of the master form (list).

On the Form Links dialog, select the linked, or slave, form or list in the list of Unlinked Forms on the Desktop.

Double-click the form (list) in this list, or highlight it and choose Link

On the Edit Link  dialog, select a field of the slave form's (list's) view in the list on the left

Fields from the master form's (list's) view that can be used to match the selected slave field will appear in the list on the right

Select a master form (list) field.  The link rule will be displayed on the dialog.

You can define a link with more than pair of matching fields

Select OK on the Edit Link dialog, to create the link

Select OK on the Form Links dialog

See Linking Forms for examples.


Unlink a form or list from another

Close either form (list) to break a link

or

Active the master form (list) of the link

Select the Form Links command from either the File menu or the Form (List) menu

On Form Links dialog, select the linked form (list) in the Linked Forms list

Click the Unlink button to unlink the form (list)


Form Design How To's
Procedures for Designing Forms

Up

General Procedures

Creating a new form, editing and saving form designs

Specifying Form Data

Defining the data view, sort specification, filters

Form Layout

Laying out controls on the form, sizing and positioning forms on the desktop, layout tools

Special Features

Including a search window, lookup windows

Procedures for Using Forms


General Form Design Procedures

Up

Create a new form

Change a form design

Save a form design

Switch between run and design mode

Change the size of a form

Set the location of a form on the desktop

Include a search window

Design a form for importing or exporting data

Delete a form

Check the design of a form


Specifying Form Data

Up

Define the data view of a new form

Select the fields for a form

Specify the sort order

Specify a filter

Specify fields used in lookup windows


Form Layout

Up

Display a field on a form

Place a control on a form

Change the attributes of a control

Change the title of a control

Change the border style of a control

Make a control display-only

Change the size of a control

Move a control

Remove a control

Change an edit control to a combo box

Select a group of controls

Un-select controls

Move a group of controls

Align selected controls

Make selected controls the same size

Set the tab order of controls

Specify form fonts

Specify form colors


Special Features

Up

Include a search window on a form

Include lookup windows for fields

Specify the columns in a lookup window


Create a new form

Select the New command from the File menu

Select the option for a new form

See other How To's for details on these steps:

Enter an ID and Description for the new form, and fill out other options as desired on the Form Attributes dialog.

Define the data view for the form on the Edit View dialog.

A new form will open on the desktop in design mode

Create and place controls on the form

Design the search window if you selected that option on the Form Attributes dialog

Run form diagnostics by selecting the Run Diagnostics command on the Form Design menu.

Leave design mode by selecting the Leave Design Mode command on the Form Design menu.

Save the form.


Change a form design

Open the form by selecting the Open command on the File menu, then selecting the form from the list of stored forms.

Place the form in design mode by selecting the Design Mode command on the Form menu.

Make the desired changes

Leave design mode by selecting the Leave Design Mode command on the Form Design menu.

Run diagnostics on the form by selecting the Run Diagnostics command on the Form menu.

Save the form.


Save a form design

Ad Hoc will save a form design only if the form is in design mode, or if the form design has changed.

Make sure the form is the active desktop object

If this is a new form, make sure the ID and Description you entered on the Form Attributes dialog aren't duplicates of another form already in the database.

Select the Save command on the File menu
or
Press the F4 key


Switch to and from design mode

To put a form in design mode

Click the right mouse button when the cursor is over any uncovered area of the form

Select the Design Mode command on the Form menu

To take a form out of design mode

Click the right mouse button when the cursor is over any uncovered area of the form

Select the Leave Design Mode command on the Form Design menu


Delete a form design

To remove a form design from the database

Select the Delete command on the File menu.

Select the form from the list of stored forms

Confirm that you want to delete the form


Check the design of a form

Select the Run Diagnostics command on the Form menu or the Form Design menu


Change the size of a form

Place the form in design mode by selecting the Design Mode command on the Form menu.

Drag the border of the form with the mouse, just as you would re-size any window.

Make sure all the controls appear on the form without having to scroll it.  If all controls are fully within the border of the form, there will be no scroll bars on the form itself.

Leave design mode and save the form design


Change the location of a form on the desktop

When a form is opened, its initial position on the desktop is the position it had when the design was last saved.  To change the initial position

Place the form in design mode

Move the form to the desired position by dragging it by the title bar

Leave design mode and save the form design


Include a search window on a form

Put the form in design mode

Select the Form Attributes command on the Form Design menu to display the Form Attributes dialog

Check the Search Window option

Click the Search icon [image] to display the search window

Drag the search window to the appropriate size and design it.  See Designing a Form Search Window.

Press Esc to close the search window

Leave design mode and save the form design


Design a form for importing and exporting data

Put the form in design mode

Select the Form Attributes command on the Form Design menu

Check the Data Exchange Template option

Select the Data Exchange Template command on the Form Design menu

See Designing Data Exchange Template for details

Leave design mode and save the form design


Define the data view of a new form

When you create a new form, the Edit View dialog is displayed automatically.  You must define a data view before you can lay out the form.  On the Edit View dialog:

Specify the table whose records you want to edit as the root table.

Add the fields you want to display on the form to the Fields in the View list.

In most cases, don't specify a sort or filter for the form's view (see other help topics in this section)

When you accept the entries on the Edit View dialog, the form window is displayed in design mode and you can design the form layout.


Select the fields for a form

Specify the database fields that will appear on a form on the Edit View dialog.

Guidelines for selecting fields

Select all fields from the root table that you want to edit on the form

If the form will be used to add new records, you must at least include all the fields in the root table that have been defined as required fields.

Select fields from other tables linked to the root table if you want to display them on the form for informational purposes.  Linked fields cannot be edited.

If there is a link to another table defined for a field (See Table Links) the field will have a lookup window attached.  Include fields from the linked table that you want to appear in the lookup window to help with the lookup.  (See Designing Lookup Windows).


Specify the sort order of a form

In most cases, don't specify a sort order.  You can't add or delete records from a form that has a sort order that is not an index of the root table.

Add a search window to the form.  You can select an index on the search window while using the form, and that selection also applies to order of records on the form.

A form without a search window or sort specification is sorted by the primary key index.

For special purposes, you can specify a non-index sort order for a form, but you can only edit records in this case and the form must perform a sort each time it opens.


Specify a filter for a form

If you want to use the form to edit a subset of records in the root table, you can select the records the form will display by specifying a filter in the data view.

Put the form in design mode

Select the Data View command on the Form Design menu to display the Edit View dialog.

Click the Filter button to define the filter.  See Filter Rules Dialog and Edit Filter Rule Dialog.

Leave design mode and save the form design (unless the filter is needed only for the current session).

Note: The search window will have the same filter as the form.


Specify fields used in lookup windows

A lookup window displays fields from another table linked to the root table.  The lookup window for a particular fields is controlled by the Table Link used to validate that field.

All linked fields defined by this link that are included in the data view for the form will appear automatically as columns in the lookup window.

If you don't specify any linked fields, only the primary key field(s) of the linked table will appear in the lookup window.

See Designing Lookup Windows.


Display a field on a form

A field is displayed on a form by placing a form control on the form.  See Designing Form Controls.


Place a control on a form

Click the right mouse button over an uncovered area of a form in design mode

Select one of the four New control commands for the type of control you want

Describe the control on the control attributes dialog and accept the dialog entries

Move the mouse cursor to the location for the top left corner of the control

Click the left button

Drag and size the control as necessary

See Designing Form Controls for details


Change the attributes of a control

Put the form in design mode

Move the mouse cursor over the control or its title

Click the right mouse button

Change the attributes on the control attributes dialog

You can also

Select the control by tabbing to it or clicking it with the left mouse button

Select the Edit Selected Controls command on the Form Design menu

If more than one control is selected, the appropriate control attributes dialogs will be displayed sequentially for the selected controls


Change the title of a control

With the form in design mode, click the right mouse button on the control

Change the title on the control attributes dialog

See Change the attributes of a control


Change the border style of a control

You can change the border style for edit controls and text boxes.

With the form in design mode, click the right mouse button on the control to display the control attributes dialog

Select either the None, Underline, or Border option for edit controls

Set the Border and Vertical Scroll Bar options on or off for text boxes.

See Designing Form Controls for details.


Make a control display-only

With the form in design mode, click the right mouse button on the control to display the control attributes dialog

Check the Display Only style

Note:

Combo box controls cannot be set to display-only - use a display only edit control instead.

Controls that will automatically be display only include

Controls for linked fields not in the root table

Controls for fields that are part of indexes defined as non-modifiable, except when the form is adding a new record


Change the size of a control

Select the control by clicking on it with the left mouse button.  A dotted outline defining the selection border of the control will appear.

Move the mouse cursor to an edge or corner of the selection border until the cursor changes shape.

Drag the border until the control is the desired size.

The height of an edit control is determined by the size of the font.  You can change its width only.

See Sizing Controls


Move a control

Select the control by clicking on it with the left mouse button.  The selection border will appear.

Click and hold the left mouse button and drag the control to the desired location.
or
Press the arrow keys (up, down, left, or right) to move the control.
Press Enter to accept the move, or Esc to cancel the move

Avoid overlapping controls on the form

See Moving Controls


Remove a control from a form

Click on the control with the left mouse button to select it

Press the Del key
or
Select the Delete Control command on the Form Design menu


Change an edit control to a combo box

Remove the edit control

Insert a new combo box control for the same field

You can use a combo box control only for fields that have been defined with the Lookup validation type.  See Define Field Dialog.


Select a group of controls

Drag a selection rectangle around the controls to be selected

or

Hold the Shift key and click on each controls with the left mouse button

or

Hold the Shift key and press the Tab key to move from control to control

See Selecting Controls.


Un-select controls

To un-select all controls, click the left mouse button on an area of the form not covered by a control

To un-select one control when a group of controls is selected, hold the Shift key down and click the left mouse button on that control


Move a group of controls

Select the controls to be moved

Click on any one of the selected controls with the left mouse button

Drag the group to the desired location and release the mouse button

See Moving Controls.


Align selected controls on a form

Select the controls you want to align

Click on the appropriate alignment icon on the control pad

See Aligning Controls.


Make selected controls the same size

A group of selected controls can be made the same widths, either growing all to the width of the largest, or shrinking all to the width of the smallest.

Select the controls

Click one of the two alignment sizing icons on the control pad.

See Aligning Controls.


Set the tab order of controls

Select the Set Tab Order command on the Form Design menu

Click the left mouse button on each control on the form, in the order you want to use for tabbing

See Changing the Tab Order of Controls.


Specify form fonts

With the form in design mode, select the Fonts command on the Form Design menu to display the Fonts dialog.  See Fonts Dialog for details.


Specify form colors

With the form in design mode, select the Colors command on the Form Design menu to display the Colors dialog.  See Colors Dialog for details.


Include a search window on a form

With the form in design mode, select the Form Attributes command on the Form Design menu.

On the Form Attributes, check the Search Window feature.

Select OK to put away the dialog

Click the Search [image] icon on the form control pad to display the new search window

With the left mouse button, drag the bottom right corner of the search window to make an appropriate size

See help on Designing Lists for details, using the following guidelines:

The root table of the search window view must be the same table as that of the form

Include the fields in the view that you want to appear in the search window columns

Don't specify a sort or filter for the search window

Select the sort option in the list sort control that you want to be the default for the form itself.


Include lookup windows for fields

Ad Hoc automatically includes a lookup window for each control on the form associated with a field that:

Has a validation type specified in the data dictionary

Is specified in a link to another table


Specify the columns in a lookup window for a control

With the form in design mode, select the Edit View command on the Form Design menu to display the Edit View dialog

In the "Fields in the root table" list on the right side of the dialog, find and highlight the link ID for which the field to be looked up is the foreign key

Click the More button to display the fields from the linked (lookup) table

Add the desired fields from this list to the Fields in the View list by highlighting each and selecting Add, or double-clicking each entry.

Select OK on the Edit View dialog

All fields selected from the linked table will as columns in the lookup window


Procedures Index

Desktop

Setting Options

Databases

Forms

Designing Forms

Lists

Designing Lists

Printing and Displaying Reports

Designing Reports

Diagnosing Problems


Desktop Procedures

Up

Open a database

Close a database

Open a form or list

Close an object on the desktop

Save a desktop layout

Retrieve a previously saved desktop layout

Display the Tables Window

Exit Ad Hoc


Open a database

When no database is currently open

If the database appears among the recent database entries on the File menu, select it

otherwise

Select the Open Database command on the File menu

Use the Open dialog to find and select the data dictionary file (the file name is the database ID and file extension .ddf) for the desired database

Select OK

To open a different database when one is already open

If the database was recently open, select its entry at the bottom of the Database menu

otherwise

Select the Open Database command on the Database menu

Use the Open dialog to find and select the data dictionary file (ending in .ddf) for the database to open

Select OK


Close a database

Select the Close command on the Database menu.


Open a form or list

Select the Open command on the File menu

Select the desired form or list from the Open dialog

Select OK


Close an object on the desktop

To close any desktop object, including forms .lists, report windows, and the Tables window:

Make sure the object is the active desktop object

Select the Close command on the File menu
or
Double-click the system menu icon in the upper left corner of the desktop object

To close all desktop objects, select the Close All command on the Window menu


Save a desktop layout

To save the current layout of forms and lists, and any links between them:

Select the Save Desktop command on the File menu

Supply an identifier for the layout an a description on the Save Desktop dialog

Select OK


Retrieve a previously saved desktop layout

Objects currently on the desktop will still be there after you retrieve a layout unless you close them first

Select the Open command on the File menu

Make sure the Desktop option is checked on the Open dialog so that desktop layouts are included in the list

Highlight the entry for the desktop layout and select OK or double-click the entry


Display the Tables Window

Select the Show Tables Window command on the Tables menu

or

Press F10


Exit Ad Hoc

Select the Exit on the File menu

or

Double-click the system menu icon on the Ad Hoc main window


Setting Options

Up

Specify startup screen display options

Specify keystroke navigation option for lists

Turn record locking on and off

Set confirmation options for selected actions

Specify the commands on the desktop fastmenu

Specify diagnostic warning levels


Specify startup screen display options

Select the Desktop Configuration command on the Options menu

Set the Desktop Options you want on the displayed Desktop Configuration dialog.

Select OK.


Specify keystroke navigation option for lists

Select the Desktop Configuration command on the Options menu

Set the Keystroke Navigation for Lists options on the displayed Desktop Configuration dialog

Select OK.


Turn record locking on and off

Select the Database Options command on the Options menu

Set the Record Locking option on the displayed Database Options dialog.

Select OK.


Set confirmation options for selected actions

Select the Confirmation Options command on the Options menu

Set the options on the Confirmation Options dialog

Select OK.


Specify the commands to appear on the desktop fastmenu

Select the FastMenu Options command on the Options menu

In the top panel of the displayed FastMenu Options dialog, select the commands you want to appear on the desktop fastmenu

If you selected the List of recent reports option, specify in the middle panel of the dialog the subcommands for each recent report listed on the fastmenu

If you selected the recent forms or recent reports options in the top panel, specify in the bottom panel the maximum number of recent form or report entries that will appear on the fastmenu

Select OK.


Specify diagnostic warning levels

Select the Diagnostics Options command on the Options menu

On the displayed Diagnostics Options dialog, specify the severity level of design errors that will cause a diagnostics report to be displayed each time:

a form or list is opened

a report is printed

a database is opened

Select OK.


Diagnosing Problems

Up

Check the file status of a database table

Check the design of a database table

Check the design of entire data dictionary

Check the design of a form or list

Check the design of a report


Check the file status of a database table

Select the Show Tables Window command on the Tables menu, or press F10, to display the Tables Window

Find the table in the list of database tables

If the Status column shows No File for the table, see Missing Database Table Files

If the Status column shows Error in file, see Damaged Database Table Files


Check the design of a database table

Select the Show Tables Window command on the Tables menu, or press F10, to display the Tables Window

Highlight the desired table in the list on the Tables Window

Select the Run Table Diagnostics command on the Tables menu

See Diagnostics Window for help on the window that displays the result of the diagnostics

Fix any problems by editing the table design


Check the design of entire data dictionary

Select the Show Tables Window command on the Tables menu, or press F10, to display the Tables Window

Select the Run Database Diagnostics command on the Tables menu

See Diagnostics Window for help on the window that displays the result of the diagnostics

Fix any problems by editing the design of the tables with errors


Check the design of a form or list

Use the Open command on the File menu to open the form (list)

Click the right mouse button on the form (list), or press Alt-M, to display the Form (List) menu

Select the Run Diagnostics command on the Form (List) menu

See Diagnostics Window for help on the window that displays the result of the diagnostics

If there are problems:

Select the Design Mode command on the Form (List) menu and correct the problems

Select the Save command on the File menu , or press F4, to save the modified design


Check the design of a report

Select the Design Report command on the File menu to display the report selection dialog

Select the desired report in the list and select OK to display the report design window

Select the Run Diagnostics command on the Report menu

See Diagnostics Window for help on the window that displays the result of the diagnostics

If there are problems:

 correct the report design on the report design window

Select the Save command on the File menu to save the modified design


Database Procedures

Up

General Procedures

Create, open, close, a database, add a table

Tables

Table design procedures

Database Maintenance


General Database Procedures

Up

Create a new database

Open a database

Close a database

Design a database

Make changes to a database design

Delete a database

Add a new table

Delete a table


Tables

Up

Add a field to a table

Remove a field from a table

Change the definition of field

Add an index to a table

Remove an index from a table

Define a link (relation) between two tables


Database Maintenance

Up

Rebuild a database file

Reclaim unused space in a file


Create a new database

Select the Create New Database command on the Database menu (or on the File menu is no database is currently open)

Assign the new database an ID, Description, and a subdirectory location on the New Database dialog

Select OK

See Creating a New Database for details


Design a database

Close all forms, lists, and reports that are open on the desktop

Select the Show Tables Window command on the Tables menu to open the Tables Window

Select commands on the Tables menu to add tables and edit table definitions

See Designing a Database for details


Make changes to a database design

Close all forms, lists, and reports that are open on the desktop

Select the Show Tables Window command on the Tables menu to open the Tables Window

Select commands on the Tables menu to add tables and edit table definitions

See Changing a Database Design for details


Delete a database

See Deleting a Database


Add a new table

Select the Show Tables Window command on the Tables menu to open the Tables Window

Select the New Table on the Tables menu to display the Database Table dialog

Define the new table on the dialog and select OK

Verify that the Status column on the Tables Window shows that a file was created for the table

See Designing a New Table for an overview of the steps in designing a table


Delete a table

Close all open forms, lists, and reports on the desktop

Select the Show Tables Window command on the Tables menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Delete Table command on the Tables menu

Confirm that you want to remove the table definition from the data dictionary

Ad Hoc will ask you if you also want to delete the DOS file for the table, Select Yes to delete the table file


Add a field to a table

Close all open forms, lists, and reports on the desktop

Select the Show Tables Window command on the Tables menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Edit Table Definition command on the Tables menu

Select the Fields button to display the table fields

Select Add to add a new field at the end of the list
or
Highlight an entry in the list and select Insert to insert a new field before that entry

Define the field on the Define Field dialog

Select OK on the Define Field Dialog

Select OK on the Database Table Dialog

If the table contains records, Ad Hoc will rebuild it to add the new field.  The field will contain a null value in all records.


Remove a field from a table

Close all open forms, lists, and reports on the desktop

Select the Show Tables Window command on the Tables menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Edit Table Definition command on the Tables menu

Select the Fields button to display the table fields

Highlight the entry for the field in the Fields list

Select Delete

Select OK on the Database Table Dialog

If the table contains records, Ad Hoc will rebuild it to delete the field from all records.


Change the definition of field

Close all open forms, lists, and reports on the desktop

Select the Show Tables Window command on the Tables menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Edit Table Definition command on the Tables menu

Select the Fields button to display the table fields

Highlight the field in the Fields list

Select Change to display the Define Field dialog

Modify the definition of the field

Select OK on the Define Field Dialog

Select OK on the Database Table Dialog

If you have changed the data type and size of the field, and the table contains records, Ad Hoc will rebuild the table to change the way the field is stored in each record.  If you have changed the data type, Ad Hoc will attempt to translate the old value of the field to the new type.  If this is not possible, the field will be blanked in each record.


Add an index to a table

Close all open forms, lists, and reports on the desktop

Select the Show Tables Window command on the Tables menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Edit Table Definition command on the Tables menu

Select the Indexes button to display the table indexes

Select Add to add an index to the end of the list
or
Highlight an entry and select Insert to insert a new index before the entry

Don't put the new index at the top of the list unless it is to be the primary key index

Define the index on the Define Index dialog

Select OK on the Define Index dialog

Select OK on the Database Table dialog

Ad Hoc will rebuild the table file to add the new index


Remove an index from a table

Close all open forms, lists, and reports on the desktop

Select the Show Tables Window command on the Tables menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Edit Table Definition command on the Tables menu

Select the Indexes button to display the table indexes

Highlight the index

Don't delete the first index in the list (the primary key index unless you intend to make the one below it the new primary key index

Select Delete to delete the index from the table definition

Select OK on the Database Table dialog

Ad Hoc will rebuild the table file to remove the index


Define a link (relation) between two tables

Close all open forms, lists, and reports on the desktop

Select the Show Tables Window command on the Tables menu to open the Tables Window

Highlight the entry for the table on the Tables Window

Select the Edit Table Definition command on the Tables menu

Select the Links button on the Database Table dialog to display the list of links for the table

Select Add to display the Edit Link dialog

Define the link (see Table Links for help on links and Edit Link Dialog for help on using the dialog

Select OK on the Edit Link dialog

Select OK on the Database Table dialog


Rebuild a database file

Select the Show Tables Window command on the Tables menu to display the Tables Window

Highlight the entry for the database table that you want to rebuild

Select the Rebuild Table File command on the Tables menu

Confirm that you want to rebuild the table

When the rebuild process is completed, press OK on the process window to close it


Reclaim unused space in a file

See Using the Rebuild command to shrink a database file


Procedures for Lists
Procedure for Lists

Up

General Procedures

Opening and closing lists.  The procedures are the same as for forms.

Using Lists to Display Data

Scrolling, finding records

Using Lists to Edit Data

Adding, changing, deleting records

Other Procedures

Saving desktop layouts, Linking lists and forms on the desktop

Procedures for Designing Lists


General List Procedures

Up

Open a list

Close a list

Close all objects on the desktop

Remove a list from the database

Save a list design to an external file

Read a list design from an external file


Using Lists to Display Data

Up

Scroll through records on a list

Find a record

Change the sort order of a list


Using Lists to Edit Data

Up

Edit a record

Canceling changes to a record

Add a new record to the database

Delete a record


Other List Procedures

Up

Link a list to another

Unlink a list from another


Scroll through records on a list

To highlight the first record: Press the Home key, or drag the scroll box to the top of the scroll bar

To highlight the last record: Press the End key, or drag the scroll box to the bottom of the scroll bar

Move the highlight up or down with the up an down keys, or click on the scroll bar arrows

Move the highlight up or down a screen full at a time by pressing the PgUp or PgDn keys, or clicking in the area of the scroll bar between the arrows and the scroll box


Find a record on a list

Use the list's search control

Use keystroke navigation


Change the sort order of a list

Use the list's sort control to change the sort order to either one of the indexes of the lists's root table or the sort specification (if any) defined on the Edit View dialog for the list


Edit a record

You can edit records on a list only if it has the AddEditDelete style.  See Designing Lists

Highlight the record in the list

Select Edit by Clicking the Edit button or pressing Alt-E
or
Double-click the record in the list

Make changes on the pop-up edit form

Press Enter or click the Update [image] icon


Canceling changes to a record

Click the Cancel [image] icon on the pop-up edit form.


Add a new record to the database

You can add records using a list only if it has the AddEditDelete style.  See Designing Lists

Select Add by clicking the Add button or pressing Alt-A to display the pop-up edit form

Fill out the form

Press Enter or Click the Update [image] icon


Delete a record

You can delete records using a list only if it has the AddEditDelete style.  See Designing Lists

Highlight the record in the list

Select Delete by clicking the Delete button or pressing Alt-D


List Design How To's
Procedures for Designing Lists

Up

General Procedures

Creating a new list, editing and saving list designs

Specifying List Data

Defining the data view, sort specification, filters

List Layout

Placing controls on the list, laying out columns

Procedures for Using Lists


General List Design Procedures

Up

Create a new list

Change a list design

Save a list design

Switch between run and design mode

Change the size of a list

Set the location of a list on the desktop

Delete a list

Check the design of a list


Specifying Data on a List

Up

Define the data view of a new list

Select the fields for a list

Specify the sort order

Specify a filter

Specify fields used on the pop-up edit form


List Layout

Up

Specify a sort control on a list

Specify a search control on a list

Specify the columns in  a list

Specify list column headings

Specify column widths

Specify the alignment style of a column

Include an edit form with a list

Specify fonts on a list

Specify colors on a list


Create a new list

Select the New command from the File menu

Select the option for a new list

See other How To's for details on these steps:

Enter an ID and Description for the new list, and specify other options as desired on the List Attributes dialog.

Define the data view for the list on the Edit View dialog.

A new list will open on the desktop in design mode

Specify the columns in the list by selecting displayed fields on the List Attributes dialog

Size and align the columns

Run diagnostics by selecting the Run Diagnostics command on the List Design menu.

Leave design mode by selecting the Leave Design Mode command on the List Design menu.

Save the list.


Change a list design

Open the list by selecting the Open command on the File menu, then selecting the list from the Open dialog.

Place the list in design mode by selecting the Design Mode command on the List menu.

Make the desired changes

Leave design mode by selecting the Leave Design Mode command on the List Design menu.

Run diagnostics on the list by selecting the Run Diagnostics command on the List menu.

Select the Save command on the File menu to save the list.


Save a list design

Ad Hoc will save a list design only if the list is in design mode, or if the list design has changed.

Make sure the list is the active desktop object

If this is a new list, make sure the ID and Description you entered on the List Attributes dialog aren't duplicates of another form or list already in the database.

Select the Save command on the File menu
or
Press the F4 key


Switch to and from design mode

To put a list in design mode

Click the right mouse button when the cursor is over the list

Select the Design Mode command on the List menu

To take a list out of design mode

Click the right mouse button when the cursor is over the list

Select the Leave Design Mode command on the List Design menu


Delete a list design

To remove a list design from the database

Select the Delete command on the File menu.

Select the list from the list on the Delete dialog

Confirm that you want to delete the list


Check the design of a list

Select the Run Diagnostics command on the List menu or the List Design menu


Change the size of a list

Place the list in design mode by selecting the Design Mode command on the List menu.

Drag the border of the list with the mouse, just as you would re-size any window.

Leave design mode and save the list design

This is the size the list will be when it first opens.  After a list is open, you can change the size at any time in the same way.  You can also maximize the list.


Change the location of a list on the desktop

When a list is opened, its initial position on the desktop is the position it had when the design was last saved.  To change the initial position

Place the list in design mode

Move the list to the desired position by dragging its title bar, size the list by dragging its border

Leave design mode and save the list design


Define the data view of a new list

When you create a new list, the Edit View dialog is displayed automatically.  You must define a data view before you can specify the columns of the list or lay out the (optional) edit form.  On the Edit View dialog:

Specify the primary table associated with the list as the root table.  If you are editing fields on a pop-up edit form, only fields from the root table can be edited.

Add the fields you want to display in the list columns or the edit form to the Fields in the View list.

Specify a sort or filter for the lists's view (see other help topics in this section)

When you accept the entries on the Edit View dialog, the list is displayed in design mode.


Select the fields for a list

Specify the database fields that will appear in the columns or edit form of the list on the Edit View dialog.

Guidelines for selecting fields

Select all fields from the root table that you want to display in columns on the list, or edit on the (optional) edit form

If the edit form will be used to add new records, you must at least include in the view and on the edit form all the fields in the root table that have been defined as required fields.

Select fields from other tables linked to the root table if you want to include them in list columns or on the edit form for informational purposes.  Linked fields cannot be edited.

If there is a link to another table defined for a field (See Table Links) the corresponding control on the edit form will have a lookup window attached.  Include fields from the linked table that you want to appear in the lookup window.  (See Designing Lookup Windows).


Specify the sort order of a list

In most cases, don't specify a sort order.  A list can automatically be ordered by the indexes of it's view's root table.  Adding an additional sort specification to the view definition will required the list to be sorted each time it opens.

For special purposes, you can specify a non-index sort order for a list by specifying a sort specification on the Edit View dialog.


Specify a filter for a list

Put the list in design mode

Select the Data View command on the List Design menu to display the Edit View dialog.

Click the Filter button to define the filter.  See Filter Rules Dialog and Edit Filter Rule Dialog.

Leave design mode and save the list design (unless the filter is needed only for the current session).


Specify fields used on the pop-up edit form

If a list has an attached edit form, the form shares the same view as the list.  Include the fields to be on the form when you specify the fields for the list's data view.  Only fields in the root table of the view can be edited on the form.

Design the fields of the edit form of a list just as you would with a desktop form.


Specify a sort control on a list

With the list in design mode, select the List Attributes command on the List Design menu to display the List Attributes dialog

In the Style panel of the dialog, check the Sort Control option

Select OK


Specify a search control on a list

With the list in design mode, select the List Attributes command on the List Design menu to display the List Attributes dialog

In the Style panel of the dialog, check the Search Control option

Select OK


Specify the columns in  a list

With the list in design mode, select the Data View command on the List Design menu to display the Edit View dialog

Add a field to the Fields in the View list for each column you want in the list

Select OK

Select the List Attributes command on the List Design menu to display the List Attributes dialog

In the Displayed Fields panel of the dialog, the fields in the data view are shown in the list on the right.  Select the fields to be displayed in the list columns in the order you want them to appear, from right to left

Select OK on the List Attributes dialog


Specify list column headings

Select the List Attributes command on the List Design menu to display the List Attributes dialog

Check the Column Headings option in the Style pane of the dialog

Ad Hoc will assign as default column headings the titles you entered for the fields when you defined them

To change a column heading

Highlight the corresponding field in the Displayed Fields list

Edit the column heading for this field in the Column Heading edit control

To create a multi-line heading, press Enter to start a new line


Specify column widths

With the list in design mode, move the mouse cursor to the tab in the list's tab bar that is to the  right of the column you want to size.

Click and drag the tab with the left mouse button

To move all tabs to the right of the one you are dragging, hold down the Shift key before you drag the tab


Specify the alignment style of a column

With the list in design mode, click the right mouse button on the tab in the list's tab bar that is associated with the column

Select the alignment style from the displayed tab menu

Drag the tab as necessary to place the column


Include an edit form with a list

With the list in design mode, select the List Attributes command on the List Design menu to display the List Attributes dialog

Select the AddEditDelete style

Select the Database Access permission options you want for the list

Select OK

Select the Data View command on the List Design menu to display the Edit View dialog

Include in the view fields the fields you want to appear on the edit form

 Select OK

Click the Edit button (or Add button if its not grayed) on the list to display the pop-up edit form

Drag the bottom right corner of the edit form with the mouse to size it

Design the layout of the form just as you would a desktop form (See Designing Forms or How To topics on designing forms)

Click the Cancel [image] icon on the edit form, or select the Hide Pop-up Form command from its Design menu to hide the edit form


Specify fonts on a list

With the list in design mode, select the Fonts command on the List Design menu to display the Fonts dialog


Specify colors on a list

With the list in design mode, select the Colors command on the List Design menu to display the Colors dialog


Limited Warranty

This software and accompanying files and documentation are licensed "as is" and without any warranty as to performance or fitness for any particular use, or any other warranties expressed or implied.  The user must assume the entire risk of using this program.

If you have paid the registration fee for a license to use the software, and have received a registered version of the software from ExLogica, ExLogica warrants that the disks provided are free from defects in material and workmanship, assuming normal use, for a period of 90 days from the date of registration.  If a defect in the disk occurs during this warranty period, you may return the disk(s) for a replacement.

EXLOGICA DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE PRODUCT.  SHOULD THE PROGRAM PROVE DEFECTIVE, THE PURCHASER ASSUMES THE RISK OF PAYING THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION AND ANY INCIDENTAL OR CONSEQUENTIAL DAMAGES.  IN NO EVENT WILL EXLOGICA  BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF DATA, OR THE LIKE) ARISING OUT OF THE USE OR THE INABILITY TO USE THIS PRODUCT  EVEN IF EXLOGICA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

In no event shall the liability of ExLogica for any damages to you or any other person exceed the lesser of the suggested list price or the actual price paid for the license to use the software, regardless of any form of the claim.

Your use of this product for any period of time constitutes your acceptance of this agreement and subjects you to its contents.


Ad Hoc Order Form

Send this completed form, along with your payment in US Dollars drawn on a US bank, to

ExLogica
59 Golden Eagle Lane
Littleton, CO 80127-5750
USA

Specify diskette size:	___ 3.5" (1.44MB)	___ 5.25" (1.2MB)

_____ copies of Ad Hoc   @ $49.95 each	$	___________

US shipping and handling @ $5.00 each	___________

Canada/Mexico shipping and handling @ $8.00 each	___________

International shipping and handling @ $12.00 each	___________

Colorado residents add 3% sales tax	___________

Total Payment	$	___________

Name	Date

Company

Address

City, State, Zip (Postal Code)

Country

Telephone (in case of problems with your order)	Fax

Compuserve ID (or other Electronic Mail Address)

How did you hear about Ad Hoc?

Comments:


Technical Support and Questions

Technical support is available from ExLogica at no charge through the following means:

Electronic mail on Compuserve (user ID 75136,1033)

US Mail.  Send questions to:

ExLogica
59 Golden Eagle Lane
Littleton, CO 80127-5750

Fax at (303) 933-8553

Support to registered users will receive priority.  Due to the low price of Ad Hoc, we regret that we cannot offer telephone (voice) support generally.  Telephone support will be available to registered users on a limited basis.

If you have a question about a feature or a procedure in Ad Hoc, please try to find the answer in the on-line help system first.  If you still have a problem, please include the following information in your query:

The type of computer you are using, and the amount of memory.  Are you on a network?

The version of DOS/Windows you are running

What you were doing in Ad Hoc when the problem occurred.

The messages or warnings you received.

How we can get back to you by Compuserve Email, fax, or mailing address.